CTSchedule schedule = (CTSchedule) getScheduler().getSchedule();
Iterator eventGenerators = schedule
.get(CTSchedule.EVENT_GENERATORS).actorIterator();
while (eventGenerators.hasNext() && !_stopRequested) {
Actor actor = (Actor) eventGenerators.next();
if (_debugging && _verbose) {
_debug("Prefire event generator: "
+ ((Nameable) actor).getName() + " at time "
+ getModelTime());
}
if (!actor.prefire()) {
_setExecutionPhase(CTExecutionPhase.UNKNOWN_PHASE);
throw new IllegalActionException(
actor,
"Actor is not ready to fire. In the CT domain, "
+ "all event generators should be ready to fire"
+ " at all times.\n"
+ "Does the actor only operate on sequence "
+ "of tokens?");
} else {
if (_debugging) {
_debug("Fire event generator : "
+ ((Nameable) actor).getName() + " at time "
+ getModelTime());
}
actor.fire();
}
}
} finally {
_setExecutionPhase(CTExecutionPhase.UNKNOWN_PHASE);
}