[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Probes
From: |
Fred Wan |
Subject: |
RE: Probes |
Date: |
Thu, 15 Mar 2001 14:51:00 +0100 |
Probes appeared to be useful because they automatically update themselves
(at least the visual ones) and they are able to do some basis statistics
(averaging). The non-visual ones don't seem to have that advantage. The code
fragment belows shows how a bugList is traversed to pick a bug (i.c., Bug
#1), how it is tried to change its colour (doesn't work) and how MesageProbe
is retrieved (with getProbeForMessage, which is a method of a SwarmObject!)
to print out the X-position of the bug. To feed this to a file, an activity
needs to be scheduled to do this repeatedly. It now seems easier to do that
by calling the accessor method of the bug directly (as a scheduled
activity). Would any of these two ways be recommended, or is there a better
way?
Thanks,
Fred.
SimpleBug targetBug;
for(int i=0; i < bugList.getCount();i++) {
if( ( ((targetBug =
(SimpleBug)(bugList.atOffset(i))).getBugNumber()) == 1) ) {
Globals.env.createProbeDisplay(bugList.atOffset(i));
((SimpleBug)(bugList.atOffset(i))).setBugColor((byte)4); //werkt
niet
MessageProbe bug1MessageProbe =
targetBug.getProbeForMessage("getXPos");
System.out.println("The Xpos of Bug #1 is (retrieved with
MessageProbe): " +
bug1MessageProbe.doubleDynamicCallOn(targetBug));
}
}
> FW> to call probeMap.getProbeForMessage (messageName). Maybe this can
> FW> be clarified as well. In general, the class ProbeDisplay is used
> FW> to display ProbeMaps, but in this case, to display the probemap of
> FW> the agent I used a special makeProbeAtX$Y message to a
> FW> Object2dDisplay. Where is the probeMap of this object?
>
> For ProbeDisplays created in these ways (as opposed to manually, where
> you could set one explicitly), ProbeMaps come from the ProbeLibrary,
> which, unless a specific ProbeMap is registered by the user, will make
> a basic ProbeMap with the immediate fields and methods.
>
>
> ==================================
> 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.
- Probes, Fred Wan, 2001/03/06
- RE: Probes, Fred Wan, 2001/03/14
- Re: Probes, Marcus G. Daniels, 2001/03/14
- RE: Probes,
Fred Wan <=
- Re: Probes, Marcus G. Daniels, 2001/03/15
- RE: Probes, Fred Wan, 2001/03/16
- Re: Probes, Ralf Stephan, 2001/03/16
- Re: Probes, Marcus G. Daniels, 2001/03/16
- RE: Probes, Fred Wan, 2001/03/21
- Re: Probes, Marcus G. Daniels, 2001/03/21
- RE: Probes, Fred Wan, 2001/03/21
- Re: Probes, Paul E Johnson, 2001/03/10