/* Marcus Daniels swarm-support December 16, 1999 Would you try today's DLL/swarm.jar in ftp://ftp.santafe.edu/pub/swarm/2.0.1-fixes? The source is ftp://ftp.santafe.edu/pub/swarm/testing/swarm-1999-12-15.tar.gz. Here's a test-case that works for me: */ import swarm.Globals; import swarm.Selector; import swarm.objectbase.SwarmObjectImpl; import swarm.objectbase.SwarmImpl; import swarm.objectbase.Swarm; import swarm.activity.Schedule; import swarm.activity.ScheduleImpl; import swarm.activity.Activity; import swarm.defobj.Zone; public class TestSelectorSwarm extends SwarmImpl { class Agent { public Object idHandleEvent (Integer event, Long time) { System.out.println (this + " handling event " + event.toString () + " at time " + time.toString ()); return this; } } Agent agent; Schedule modelSchedule; public TestSelectorSwarm (Zone aZone) { super (aZone); } public Object buildObjects () { super.buildObjects (); agent = new Agent (); return this; } public Object buildActions () { super.buildActions (); modelSchedule = new ScheduleImpl (getZone (), true); Integer a = new Integer (1); Long b = new Long (2); try { modelSchedule.at$createActionTo$message (0, agent, new Selector (agent.getClass (), "idHandleEvent", false), (Object) a, (Object) b); } catch (Exception e) { e.printStackTrace (System.err); } return this; } public Activity activateIn (Swarm swarmContext) { super.activateIn (swarmContext); modelSchedule.activateIn (this); return getActivity (); } static public void main (String args []) { Globals.env.initSwarm ("TestSelectorSwarm", "0.0", "mgd@swarm.org", args); TestSelectorSwarm testSelectorSwarm = new TestSelectorSwarm (Globals.env.globalZone); testSelectorSwarm.buildObjects (); testSelectorSwarm.buildActions (); testSelectorSwarm.activateIn (null); testSelectorSwarm.getActivity ().run (); } }