Function dvcompute_branch::simulation::branch::branch_event
source · [−]pub fn branch_event<M>(comp: M) -> BranchEvent<M> where
M: Event,
Expand description
Branch a new nested computation and return its result within the current
Event
by leaving the current computation intact.
A new derivative branch with branch_level
increased by 1 is created at
the current modeling time. Then the result of the specified computation for
derivative branch is returned to the current computation.
The state of the current computation including its event queue and mutable
references RefComp
remain intact. In some sense we copy the state of the model
to derivative branch and then proceed with the derived simulation.
Only this copying operation is relatively cheap.