Given zero or more step functions, evaluates them only for times after all of the sources have turned off.
(*step_funcs)
| 5071 | |
| 5072 | |
| 5073 | def after_sources(*step_funcs): |
| 5074 | """ |
| 5075 | Given zero or more step functions, evaluates them only for times after all of the |
| 5076 | sources have turned off. |
| 5077 | """ |
| 5078 | |
| 5079 | def _after_sources(sim, todo): |
| 5080 | time = sim.fields.last_source_time() |
| 5081 | if sim.round_time() >= time: |
| 5082 | for func in step_funcs: |
| 5083 | _eval_step_func(sim, func, todo) |
| 5084 | |
| 5085 | return _after_sources |
| 5086 | |
| 5087 | |
| 5088 | def after_sources_and_time(t, *step_funcs): |