Template:Team:Paris Saclay/simbox

From 2013.igem.org

(Difference between revisions)
Line 306: Line 306:
   }
   }
   proba /= Math.pow(sim.volume, reac.inputs.length);
   proba /= Math.pow(sim.volume, reac.inputs.length);
 +
 +
  var entier= Math.floor(proba);
 +
  var frac= proba - entier;
 +
  for(var elt in usedmols)
 +
  {
 +
  if( entier * usedmols[elt] >= sim.molecules[elt].quantity )
 +
  {
 +
    var tmpe= Math.floor(sim.molecules[elt].quantity / usedmols[elt]);
 +
    if(tmpe < entier)
 +
    entier= tmpe;
 +
    frac= 0;
 +
  }
 +
  }
 +
  }
  }

Revision as of 00:09, 3 August 2013