swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

where can I find recent a swarm.jar & DLLs.


From: Narjes BELLAMINE-BEN SAOUD
Subject: where can I find recent a swarm.jar & DLLs.
Date: Mon, 02 Apr 2001 10:52:35 -0700

Hello,

I am a new user of swarm
I 've dowloaded and installed the java version swarm 2.1.1 and I am trying
to run some of the samples found  on the
http://lark.cc.ukans.edu/~pauljohn/Swarm/SwarmFaq/WorkingExampleCode/java/

I'm trying to run CanvasUsage but I need a recent swarm.jar and swarm.dll

My question is where to find the recent swarm.jar  and dll files

Thanks for your help

Sincerely

Narjes  BELLAMINE-BENSAOUD

>
>
> import swarm.Globals;
> import swarm.simtoolsgui.GUISwarmImpl;
> import swarm.defobj.Zone;
>
> import swarm.gui.Canvas;
> import swarm.gui.CanvasC;
> import swarm.gui.CanvasImpl;
> import swarm.gui.CanvasCImpl;
> import swarm.gui.OvalNodeItem;
> import swarm.gui.OvalNodeItemC;
> import swarm.gui.OvalNodeItemS;
> import swarm.gui.OvalNodeItemCImpl;
> import swarm.gui.OvalNodeItemImpl;
>
> import swarm.activity.ScheduleImpl;
> import swarm.activity.Schedule;
> import swarm.activity.Activity;
> import swarm.objectbase.Swarm;
> import swarm.Selector;
>
> import java.util.LinkedList;
> import java.util.List;
>
> public class TestCanvas extends GUISwarmImpl {
>     List bugList;
>     Schedule schedule;
>
>     final int xMax = 500;
>     final int yMax = 500;
>
>     static void main (String args[]) {
>         Globals.env.initSwarm ("TestCanvas", "0.0", "address@hidden",
>                                args);
>
>         TestCanvas testCanvas = new TestCanvas (Globals.env.globalZone);
>
>         testCanvas.buildObjects ();
>         testCanvas.buildActions ();
>         testCanvas.activateIn (null);
>         testCanvas.go ();
>     }
>
>     static int bugCount = 0;
>
>     class Bug {
>         OvalNodeItem oval;
>
>         Bug (Canvas canvas) {
>             OvalNodeItemC ovalC =
>                 new OvalNodeItemCImpl (new OvalNodeItemImpl ());
>             ovalC.createBegin (canvas.getZone ());
>             ovalC.setCanvas (canvas);
>             ovalC.setString ("Bug" + bugCount);
>
>             int x =
>                 Globals.env.uniformIntRand.getIntegerWithMin$withMax (0, 
> xMax);
>             int y =
>                 Globals.env.uniformIntRand.getIntegerWithMin$withMax (0, 
> yMax);
>
>             ovalC.setX$Y (x, y);
>             oval = (OvalNodeItem) ovalC.createEnd ();
>             move ();
>             bugCount++;
>         }
>
>         public void move () {
>             int xdelta =
>                 Globals.env.uniformIntRand.getIntegerWithMin$withMax (-5, 5);
>             int ydelta =
>                 Globals.env.uniformIntRand.getIntegerWithMin$withMax (-5, 5);
>             int x = oval.getX ();
>             int y = oval.getY ();
>
>             if (x + xdelta >= 0 && y + ydelta >= 0
>                 && x + xdelta < xMax && y + ydelta < yMax)
>                 oval.moveX$Y (xdelta, ydelta);
>         }
>     }
>
>     public TestCanvas (Zone aZone) {
>         super (aZone);
>     }
>
>     public Object buildObjects () {
>         super.buildObjects ();
>
>         CanvasC canvasC = new CanvasCImpl (new CanvasImpl ());
>         canvasC.createBegin (getZone ());
>         Canvas canvas = (Canvas) canvasC.createEnd ();
>
>         canvas.setHeight (xMax);
>         canvas.setWidth (yMax);
>         canvas.setWindowTitle ("Agents");
>         canvas.pack ();
>
>         bugList = new LinkedList ();
>
>         bugList.add (new Bug (canvas));
>         bugList.add (new Bug (canvas));
>
>         return this;
>     }
>
>     public Object buildActions () {
>         super.buildActions ();
>
>         schedule = new ScheduleImpl (getZone (), 1);
>
>         try {
>             schedule.at$createActionForEach$message
>                 (0,
>                  bugList,
>                  new Selector (Bug.class,
>                                "move",
>                                false));
>
>             schedule.at$createActionTo$message
>                 (0,
>                  getActionCache (),
>                  new Selector (getActionCache ().getClass (),
>                                "doTkEvents",
>                                false));
>         } catch (Exception e) {
>             e.printStackTrace (System.err);
>             System.exit (1);
>         }
>
>         return this;
>     }
>
>     public Activity activateIn (Swarm swarmContext) {
>         super.activateIn (swarmContext);
>
>         schedule.activateIn (this);
>         return getActivity ();
>     }
> }
>
>                   ==================================
>    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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]