Is your feature request related to a problem? Please describe.
continuous_simulation supports node_events which forces a node to a given value at a specific time, optionally holding it for a duration. This is implemented via a sequence of scipy.integrate.solve_ivp segments split at each event time (ContinuousMixin.continuous_simulation) in booldog/continuous/ode_factory.py. boolean_simulation has no equivalent: it wraps pyboolnet's state-transition-graph construction, building the full reachable STG from the initial state(s) in one call, so there's no "current time" during the run to attach a trigger to.
Current workaround
Construct a new initial state with the target node(s) pre-set, and start a fresh boolean_simulation from there. See Case (ii) in tutorials/tutorial-advanced.ipynb, which uses inactivate_state() + set_node_state() to simulate an "egf"/"tnfa" trigger. This works but requires the user to manually manage state construction and result-stitching themselves, with no chained-segment result object like ContinuousSimulationResult.
Describe the solution you'd like
Wrap the existing workaround into a first-class API, analogous to continuous_simulation's segment-based approach:
- Accept a
node_events-style parameter (list of {step_or_condition, node, value}).
- Internally, run
boolean_simulation up to each event point, force the node value in the resulting state, and re-launch from there.
- Needs a design decision on what "event time" means for a Boolean simulation (a step count, a reached-attractor condition, or something else) since discrete Boolean simulation doesn't have a single natural time axis the way ODE integration does.
Additional context
Came up in review, which asked whether events are supported the same way across both simulation modes. Opening to track idea/interest.
Is your feature request related to a problem? Please describe.
continuous_simulationsupportsnode_eventswhich forces a node to a given value at a specific time, optionally holding it for a duration. This is implemented via a sequence ofscipy.integrate.solve_ivpsegments split at each event time (ContinuousMixin.continuous_simulation) in booldog/continuous/ode_factory.py.boolean_simulationhas no equivalent: it wraps pyboolnet's state-transition-graph construction, building the full reachable STG from the initial state(s) in one call, so there's no "current time" during the run to attach a trigger to.Current workaround
Construct a new initial state with the target node(s) pre-set, and start a fresh
boolean_simulationfrom there. See Case (ii) in tutorials/tutorial-advanced.ipynb, which uses inactivate_state() + set_node_state() to simulate an "egf"/"tnfa" trigger. This works but requires the user to manually manage state construction and result-stitching themselves, with no chained-segment result object like ContinuousSimulationResult.Describe the solution you'd like
Wrap the existing workaround into a first-class API, analogous to
continuous_simulation's segment-based approach:node_events-style parameter (list of {step_or_condition, node, value}).boolean_simulationup to each event point, force the node value in the resulting state, and re-launch from there.Additional context
Came up in review, which asked whether events are supported the same way across both simulation modes. Opening to track idea/interest.