Given zero or more step functions, evaluates them only once, at the end of the run.
(*step_funcs)
| 5129 | |
| 5130 | |
| 5131 | def at_end(*step_funcs): |
| 5132 | """ |
| 5133 | Given zero or more step functions, evaluates them only once, at the end of the run. |
| 5134 | """ |
| 5135 | |
| 5136 | def _end(sim, todo): |
| 5137 | if todo == "finish": |
| 5138 | for func in step_funcs: |
| 5139 | _eval_step_func(sim, func, "step") |
| 5140 | for func in step_funcs: |
| 5141 | _eval_step_func(sim, func, "finish") |
| 5142 | |
| 5143 | return _end |
| 5144 | |
| 5145 | |
| 5146 | def at_every(dt, *step_funcs): |