swarm-support
[Top][All Lists]
Advanced

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

[no subject]


From: David Aliaga
Date: Thu, 6 Jul 2000 08:16:26 -0700 (PDT)

Hello, Swarm community.

First Again Thankyou Marcus for the help.

Anyway I got a little "mystery"  to comment with you
all.I ve been working on a simulation, with the
classical Observer Swarm-Model Swarm-Objects
structure, and now I put a EZGraph in the last part of
buildObjects of Observer Swarm. It looks like this:

 resultGraph=[EZGraph createBegin: self];
 SET_WINDOW_GEOMETRY_RECORD_NAME(resultGraph);
 [resultGraph setTitle: "Time Steps until Capture"];
 [resultGraph setAxisLabelsX: "#Trial" Y: "Required
Time Steps"];
 resultGraph= [resultGraph createEnd];

[resultGraph createSequence: "TimeSteps"
         withFeedFrom: modelSwarm 
          andSelector: M(getTimeforCap)];

Then I called this in the action group from
buildActions

 [displayActions createActionTo: self message:
M(dispresult)];

in ModelSwarm, getTimeforCap returns the length(number
of steps) of a "trial". One execution of the
aplication is made of several "trials", and each
"trial" of several "time steps". For example, the
first trial has 6 time steps, the second 20, the third
12, etc.


dispresult is a method of ObserverSwarm like this:
- dispresult
{  int c=0;
    c=[modelSwarm yaCambio];
   if(c==0) return self;
//It graphs only in the "cambio" death of a prey
    [resultGraph step];
 return self;
}

"yaCambio" is a method of Model that indicates if the
trial has finished

So the "mistery" is the following one: When I put in
coments the 2nd and 3rd line of "dispresult", the
EZGraph is update at each time step (as expected), but
the graph is ok.  But we want to display only each
time the "trial" finish (that's what the "yaCambio" is
for) So , we take the comments and actually call
"yaCambio", but We got a completely different graph!!!
that even displays as X an instance variable from
another object!. One little change and everything
change. 

gettimeforCap , the method that feeds the graph,DO get
the right results,because we can see them graph every
time step. 
.  

Do you got any idea? I though someone would like to
think about it. Anyway tomorrow I am going to give it
another think. 

David 




__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
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]