Template:Team:Paris Saclay/simbox
From 2013.igem.org
(Difference between revisions)
Line 293: | Line 293: | ||
{ | { | ||
var inid= reac.inputs[j]; | var inid= reac.inputs[j]; | ||
- | if(usedmols[inid] == undefined) | + | if(!sim.molecules[inid].const) |
- | + | { | |
- | + | if(usedmols[inid] == undefined) | |
- | + | usedmols[inid]= 1; | |
+ | else | ||
+ | usedmols[inid] ++; | ||
+ | } | ||
proba *= sim.molecules[inid].quantity; | proba *= sim.molecules[inid].quantity; | ||
} | } | ||
Line 321: | Line 324: | ||
for(var j= 0 ; j < reac.inputs.length ; ++j) | for(var j= 0 ; j < reac.inputs.length ; ++j) | ||
- | sim.molecules[reac.inputs[j]].quantity -= entier; | + | { |
+ | if(!sim.molecules[reac.inputs[j]].const) | ||
+ | sim.molecules[reac.inputs[j]].quantity -= entier; | ||
+ | } | ||
for(var j= 0 ; j < reac.outputs.length ; ++j) | for(var j= 0 ; j < reac.outputs.length ; ++j) | ||
- | sim.molecules[reac.outputs[j]].quantity += entier; | + | { |
+ | if(!sim.molecules[reac.outputs[j]].const) | ||
+ | sim.molecules[reac.outputs[j]].quantity += entier; | ||
+ | } | ||
var lastone= false; | var lastone= false; | ||
Line 331: | Line 340: | ||
{ | { | ||
for(var j= 0 ; j < reac.inputs.length ; ++j) | for(var j= 0 ; j < reac.inputs.length ; ++j) | ||
- | sim.molecules[reac.inputs[j]].quantity --; | + | { |
+ | if(!sim.molecules[reac.inputs[j]].const) | ||
+ | sim.molecules[reac.inputs[j]].quantity --; | ||
+ | } | ||
for(var j= 0 ; j < reac.outputs.length ; ++j) | for(var j= 0 ; j < reac.outputs.length ; ++j) | ||
- | sim.molecules[reac.outputs[j]].quantity ++; | + | { |
+ | if(!sim.molecules[reac.outputs[j]].const) | ||
+ | sim.molecules[reac.outputs[j]].quantity ++; | ||
+ | } | ||
} | } | ||
} | } |
Revision as of 00:14, 3 August 2013