File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -276,13 +276,19 @@ def _create_period_start_event(
276276
277277 exp_ind_id = self .get_experiment_indicator (experiment .id )
278278
279+ # Create trigger expressions
280+ # Since handling of == and !=, and distinguishing < and <=
281+ # (and > and >=), is a bit tricky in terms of root-finding,
282+ # we use these slightly more convoluted expressions.
283+ # (assuming that the indicator parameters are {0, 1})
279284 if period .is_preequilibration :
280285 trig_math = libsbml .parseL3Formula (
281- f"({ exp_ind_id } == 1 ) && ({ self ._preeq_indicator } == 1 )"
286+ f"({ exp_ind_id } > 0.5 ) && ({ self ._preeq_indicator } > 0.5 )"
282287 )
283288 else :
284289 trig_math = libsbml .parseL3Formula (
285- f"({ exp_ind_id } == 1) && ({ self ._preeq_indicator } != 1) "
290+ f"({ exp_ind_id } > 0.5) "
291+ f"&& ({ self ._preeq_indicator } < 0.5) "
286292 f"&& (time >= { period .time } )"
287293 )
288294 check (trigger .setMath (trig_math ))
You can’t perform that action at this time.
0 commit comments