Template:Team:Paris Saclay/simbox

From 2013.igem.org

(Difference between revisions)
Line 142: Line 142:
     //precomputing
     //precomputing
-
     simulations[id].reactions[i].precomp_probfactor *= simulations[id].reactions[i].probability/simulations[id].volume;
+
     simulations[id].reactions[i].precomp_probfactor *= simulations[id].cfactor/simulations[id].volume;
     if(!simulations[id].molecules[tmpid].const)
     if(!simulations[id].molecules[tmpid].const)
     {
     {
Line 164: Line 164:
     simulations[id].reactions[i].outputs[j]= tmpid;
     simulations[id].reactions[i].outputs[j]= tmpid;
-
  //precomputing
+
    //precomputing
     if(simulations[id].reactions[i].precomp_molusage[tmpid] != undefined)
     if(simulations[id].reactions[i].precomp_molusage[tmpid] != undefined)
     {
     {
Line 330: Line 330:
  for(var i= 0 ; i < sim.reac_order.length ; ++i)
  for(var i= 0 ; i < sim.reac_order.length ; ++i)
  {
  {
-
  var usedmols= new Array();
 
-
 
   var reac= sim.reactions[sim.reac_order[i]];
   var reac= sim.reactions[sim.reac_order[i]];
Line 340: Line 338:
   var entier= Math.floor(proba);
   var entier= Math.floor(proba);
   var frac= proba - entier;
   var frac= proba - entier;
-
   for(var elt in usedmols)
+
   for(var elt in reac.precomp_molusage)
   {
   {
   if( entier * reac.precomp_molusage[elt] >= sim.molecules[elt].quantity )
   if( entier * reac.precomp_molusage[elt] >= sim.molecules[elt].quantity )

Revision as of 11:10, 3 August 2013