swarm-support
[Top][All Lists]
Advanced

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

Displaying Internal State


From: David Aliaga
Subject: Displaying Internal State
Date: Mon, 23 Oct 2000 08:26:52 -0700 (PDT)

Hello Swarm community.

Could someone answer the following question:

Let's suppose I have a simulation with the usual
structure:
     main.m
     observerSwarm (.h and .m)
     modelSwarm (.h and .m)
and several Swarmobjects lets call them bugs.

In the observerSwarm there are the usual probes, and
also some graphics, etc.

The agents (Swarm objects) have some internal state 
that can not be displayed in a simple probe (for
example a 2-D array or another Swarm object).
So I want to make a method that shows the internal
state. 

When I stop the simulation and I make a probe in the
object I will have a button (message probe) that I can
click and call the method.(showInternalState).

@interface bug:Swarmobject
{
int internalState[10][20];

}
// other methods
-showTheInternalState;

The question is how can I use some widgets (for
example Raster and TextItem for this displaying. Until
now all the display has been made in Observer Swarm so
everything is simple.

I suppose something like:

-showTheInternalState
{

mycanvas=[Canvas create:[self getZone]];
texto=[TextItem create:[self getZone]];

[texto setText: internalState[0][0]];
[mycanvas addWidget: texto X: 10 Y: 10 centerFlag:
false];

[mycanvas pack];

}

or something like this but is it right? Somehow the
widgets'use seem kind of complicated (in the examples
what means "GUI_EVENT_ASYNC()" what for? I tried to
make some simple examples but 1) they dont do the
graph
2) they dont update the graph 3) or they just hang the
aplication.

Is it ok to put graphs in the methods of a
SwarmObject?
How?

Thanks a lot

David





__________________________________________________
Do You Yahoo!?
Yahoo! Messenger - Talk while you surf!  It's FREE.
http://im.yahoo.com/

                  ==================================
   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]