[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: selectors in Java
From: |
Juan A Rodriguez |
Subject: |
Re: selectors in Java |
Date: |
Thu, 16 Dec 1999 15:22:18 -0500 |
Marcus, it works. It was just my version of java-swarm.
I followed your directions and downloaded and compiled the new version below
and it works.
Thanks very much once more for your help.
Juan.
------------------------------------------------------------------------------
>>>>> "JR" == Juan A Rodriguez <address@hidden> writes:
JR> The crash rises when invoking at$createActionTo$message for a
JR> given shedule.
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", "address@hidden", args);
TestSelectorSwarm testSelectorSwarm =
new TestSelectorSwarm (Globals.env.globalZone);
testSelectorSwarm.buildObjects ();
testSelectorSwarm.buildActions ();
testSelectorSwarm.activateIn (null);
testSelectorSwarm.getActivity ().run ();
}
}
==================================
Swarm-Support is for discussion of the technical details of the day
to day usage of Swarm. For list administration needs (esp.
[un]subscribing), please send a message to <address@hidden>
with "help" in the body of the message.
==================================
Swarm-Support is for discussion of the technical details of the day
to day usage of Swarm. For list administration needs (esp.
[un]subscribing), please send a message to <address@hidden>
with "help" in the body of the message.
- Re: swarm and database, (continued)
- Re: swarm and database, Marcus G. Daniels, 1999/12/14
- Re: swarm and database, Juan A Rodriguez, 1999/12/15
- selectors in Java, Marcus G. Daniels, 1999/12/15
- Re: selectors in Java, Juan A Rodriguez, 1999/12/15
- Re: selectors in Java, Juan A Rodriguez, 1999/12/15
- Re: selectors in Java, Marcus G. Daniels, 1999/12/15
- Re: selectors in Java, Juan A Rodriguez, 1999/12/15
- Re: selectors in Java, Marcus G. Daniels, 1999/12/16
- Re: selectors in Java, Juan A Rodriguez, 1999/12/16
- Re: selectors in Java, Marcus G. Daniels, 1999/12/16
- Re: selectors in Java,
Juan A Rodriguez <=
Re: swarm and database, david ROBIN, 1999/12/15