/* Marcus Daniels Oct. 5, 1999 MN> I had to do it like this: MN> public Object moveTo(Object direction) { String dirstr = MN> (String) direction; // do something with 'dirstr' } I think this is because you are passing true as the objcFlag to Selector. For a Java method, that should be false. This works for me: */ import swarm.defobj.Zone; import swarm.activity.Schedule; import swarm.activity.ScheduleImpl; import swarm.activity.Activity; import swarm.objectbase.Swarm; import swarm.objectbase.SwarmImpl; import swarm.Selector; import swarm.Globals; public class TestModelSwarm extends SwarmImpl { Schedule schedule; Schedule stopSchedule; TestModelSwarm (Zone aZone) { super (aZone); } public void moveTo (String direction) { System.out.println ("Moving " + direction + " at: " + Globals.env.getCurrentTime ()); } public void stopRunning () { Globals.env.getCurrentSwarmActivity ().terminate (); } public Object buildActions () { schedule = new ScheduleImpl (this, 5); stopSchedule = new ScheduleImpl (this, true); try { Selector moveSel = new Selector (getClass (), "moveTo", false); Selector stopSel = new Selector (getClass (), "stopRunning", false); schedule.at$createActionTo$message (1, this, moveSel, "left"); schedule.at$createActionTo$message (3, this, moveSel, "right"); stopSchedule.at$createActionTo$message (20, this, stopSel); } catch (Exception e) { e.printStackTrace (System.err); } return this; } public Activity activateIn (Swarm swarmContext) { super.activateIn (swarmContext); schedule.activateIn (this); stopSchedule.activateIn (this); return getActivity (); } public static void main (String[] args) { Globals.env.initSwarm ("testSchedule", "2.0.1", "bug-swarm@santafe.edu", args); Swarm modelSwarm = new TestModelSwarm (Globals.env.globalZone); modelSwarm.buildActions (); modelSwarm.activateIn (null); modelSwarm.getActivity ().run (); } }