swarm-support
[Top][All Lists]
Advanced

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

Simulations within simulations


From: Marcus Vinicius Pereira Pessoa
Subject: Simulations within simulations
Date: Wed, 3 Sep 1997 08:25:37 -0300

Hi all (Ken)!

Since Ken's last suggestion I thought and worked a lot in my simulation. I 
ended choosing a solution in which I call a whole application by a function 
(inspired in Merelo's Breeder Library):

float evalFunc( id<Chromosome> a ) {

  float fit;
  PplObserverSwarm * observerSwarm;

  observerSwarm = [PplObserverSwarm create: globalZone];
  [observerSwarm buildObjects: a];
  [observerSwarm buildActions];
  [observerSwarm activateIn: nil];
  fit =  [observerSwarm pplGo];

  return fit;
}

Instead of using just one observerswarm I decided to maintain the two 
applications completely separated. From  [observerSwarm buildObjects: a] I 
populate the model(it works), and from  [observerSwarm pplGo] I receive a float 
value representing the group's fitness (it isn't working yet). Every group will 
be evaluated via this simulation, so it will be called for each group in each 
generation.

I had no major problems to make  [observerSwarm buildObjects: a], but I'm 
having some trouble in changing the GUISwarm. I created a new class named 
PplGUISwarm, that is the super class to PplObserverSwarm. PplGUISwarm has a 
method called pplGo (- (float) pplGo). Inside pplGo I'm trying to call a 
modelSwarm's method that will give the flat value to be returned. I had no 
problems in compiling the code but the method neither work nor gives an error 
message. I wonder if it may be a scope problem.

So, does anybody have a suggestion about how to make this method (-pplGo) 
return a value, or any other alternative way to allow the evalFunc method to 
receive a value?

A Note: Ken was not sure, but if I quit the inner application it doesn't end 
the whole simulation, allowing to evaluate the next agent in a loop.

Thanks in advance,

Vinicius.






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