swarm-support
[Top][All Lists]
Advanced

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

RE: Probes


From: Fred Wan
Subject: RE: Probes
Date: Wed, 21 Mar 2001 14:35:04 +0100

Hi, I still have problems with MessageProbes... It works fine under NT, but
under Solaris I get the error message below when trying to run
StartSimpleBug (all sources included). Can this be due to the fact that this
is an old swarm version (Engine: Just-In-Time 1.0.5, Java version: 1.1)? The
TestMessageProbe example you provided works on both platforms.

address@hidden(A3DMAS4)% make run
/opt/SDGswarm/2.1.1/bin/javaswarm StartSimpleBug
We just created 92bugs and put them in a List.
*** event raised for warning: WarningMessage
*** function: _i_ProbeMap__getProbeForMessage_(), file:
/src/swarm-2.1.1/src/objectbase/ProbeMap.m, line: 635
The message getXPos was not found
*** execution continuing...
java.lang.NullPointerException
        at ObserverSwarm.buildObjects(ObserverSwarm.java:166)
        at StartSimpleBug.main(StartSimpleBug.java:21)

> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden Behalf Of Marcus G. Daniels
> Sent: Thursday, March 15, 2001 7:29 PM
> To: address@hidden
> Subject: Re: Probes
>
>
> >>>>> "FW" == Fred Wan <address@hidden> writes:
>
> FW> The code fragment belows shows how a bugList is traversed to pick
> FW> a bug (i.c., Bug #1), how it is tried to change its colour
> FW> (doesn't work) and how MesageProbe is retrieved (with
> FW> getProbeForMessage, which is a method of a SwarmObject!)  to print
> FW> out the X-position of the bug.
>
> MessageProbes are working for me.  (See example below.)
>
> If you think there is a bug somehow, you'll need to write an example I
> can compile and run, not a `blurb' with undefined degrees of
> freedom...
>
> import swarm.Globals;
> import swarm.objectbase.SwarmObjectImpl;
> import swarm.objectbase.MessageProbe;
> import swarm.defobj.Zone;
>
> public class TestMessageProbe extends SwarmObjectImpl {
>
>     public double getXPos ()
>     {
>         return 2.5;
>     }
>
>     static void main (String args[]) {
>         Globals.env.initSwarm ("TestMessageProbe", "address@hidden",
>                                "0.0",  args);
>         TestMessageProbe testMessageProbe =
>             new TestMessageProbe (Globals.env.globalZone);
>         testMessageProbe.test ();
>     }
>
>     TestMessageProbe (Zone aZone) {
>         super (aZone);
>     }
>
>     void test () {
>         MessageProbe messageProbe = getProbeForMessage ("getXPos");
>
>         System.out.println (messageProbe.doubleDynamicCallOn (this));
>     }
>
> }
>
>                   ==================================
>    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.
>

Attachment: FoodSpace.java
Description: Binary data

Attachment: ModelSwarm.java
Description: Binary data

Attachment: ObserverSwarm.java
Description: Binary data

Attachment: SimpleBug.java
Description: Binary data

Attachment: StartSimpleBug.java
Description: Binary data

Attachment: SimpleBug.scm
Description: application/icq-scm

Attachment: Makefile
Description: Binary data


reply via email to

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