I forgot to add this:
You're going to need to perform the split outside of a step() method,
because there may be several things on the stack ready to go, and
stacks won't serialize or clone of course. Instead, the split will
have to happen in the outer loop which pulses the schedule itself.
This may put a bit of a kink in your style in terms of building your
model -- and you'll have to handle the split-test code manually.
Assuming you could reset your simulation state, another possible
approach would be to create subschedules. The idea would be this.
An agent, during its step() method, decides the simulation needs to
be split for a while. The agent copies away the current simulation
state, or whatever is necessary, storing the copy as a local
variable. Then it creates a MASON schedule (we'd have to make sure
everything works nicely there but it should), loads it with agents,
and runs it. Then it destroys the schedule , copies back from the
local variable, creates another MASON schedule, loads it with agents,
and runs *it*, and so on. When done branching, we copy back from the
local variable and return from the step() method maybe.