I am having trouble scheduling events in the SimState.  I'm guessing I'm missing something basic here -- perhaps the schedule has to be initialized?  When I add steppable agents or anonymous steppable objects, the step function does not get called.  Below is a simplified version to show the problem.  Using doLoop() or calling schedule.step() myself, the print statement in masterStep() does not execute.

This setup seems to mirror that in the tutorials and documentation, so I'm not sure what I'm missing here.


package schedPackage;

import sim.engine.SimState;
import sim.engine.Steppable;

public class ScheduleTest extends SimState {
    private static final long serialVersionUID = 1L;
public ScheduleTest(long seed) {
Steppable masterStep = new Steppable() {
            private static final long serialVersionUID = 1;
            public void step(SimState state) {
if (schedule.scheduleRepeating(masterStep) == null) {
System.out.println("ERROR: scheduling of masterStep failed");


public void masterStep() {
System.out.println("Master step executing");

public static void main(String[] args) {
//doLoop(ScheduleTest.class, args);
SimState state = new ScheduleTest(System.currentTimeMillis());
System.out.println("Starting sim...");
do {
if (!state.schedule.step(state)) break;
} while(state.schedule.getSteps() < 50);