[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Sub-swarms
From: |
Ken Cline |
Subject: |
Re: Sub-swarms |
Date: |
Mon, 4 Aug 1997 23:44:42 -0400 (EDT) |
Vinicius,
I gather you are trying to run several simulations
sequentially inside one. I haven't tried this, but that
doesn't stop me from responding [grin] ...
Some thoughts:
- ObserverSwarm's are (usually) a subclass of GUISwarm
and, as such, have a control panel. You may or
may not want more than one control panel.
- If you do want a control panel for each "run" inside
the simulation then you may have to create a new
type of control panel. For example, if you click
`quit' on any control panel I *think* this will
end the whole simulation.
- You might consider having only one ObserverSwarm and
just creating a new ModelSwarm for each "run".
This is the way I am thinking you could do it:
In main.m: No Changes
In ObserverSwarm:
Move all the code in buildObjects, buildActions, and
activateIn that builds the ModelSwarm and related
analysis objects. Put all this stuff in a new method
called `buildModelSwarm'.
Now, on the displaySchedule, create an action that
calls `buildModelSwarm'.
Use `setStateStopped' to pause between each run.
In ModelSwarm:
Put in a method that accepts a list of agents and
uses those agents to populate the model.
Also, add a method that does a "checkToStop" and
schedule this method on the model's repeating
schedule.
Finally, add a `stop' method that, when the model
decides to stop, it evaluates the current population,
passes the "most fit" agent's back to the Observer and
drops the rest.
Finally, the ModelSwarm notifies the ObserverSwarm
that it has completed so that the ObserverSwarm can
drop the unnecessary objects and then create a new
model using `buildModelSwarm' and the "most fit" from
the last run.
Again, I've never tried any of this and I have no idea if
it would even work. If you've already started on another
way then I would probably stick with that, if I were you.
(I thought someone had already built something like what
you're trying to do, but I could be mistaken.)
Does anyone else have another way?
Ken.
On Mon, 4 Aug 1997, Marcus Vinicius Pereira Pessoa wrote:
> Hi all,
>
> Im trying to call swarms within a swarm. Im making an application in
> which I will evolve a group strategy. In a model similar to hello-world,
> I will use a variation from Merelos GA lib. So I have some questions:
>
> 1) How can I call a whole application via the main-ModelSwarm?
>
> 2) From which sub-ObserverSwarm method can I receive a parameter back?
>
> 3) Will the matter previously discussed, about problems with the
> schedule, have any influence in the model?
>
> I think that the evaluation function will be something like:
>
> float evalFunc( id<Chromosome> a ) {
>
> int argc;
> char ** argv;
> PplObserverSwarm * observerSwarm;
>
> initSwarm(argc, argv);
>
> observerSwarm = [PplObserverSwarm create: globalZone];
> [observerSwarm buildObjects: a]; //here Im passing the group of
> agents
> [observerSwarm buildActions];
> [observerSwarm activateIn: nil];
> [observerSwarm go];
>
>
> return "evaluated value"; //a value must return
> }
>
> Thanks in advance,
>
> Vinicius.
>
_________________________________________________________
Ken Cline address@hidden
SAIC VOICE (410) 571-0413
Annapolis, MD FAX (301) 261-8427
================================= 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.
================================
- Sub-swarms, Marcus Vinicius Pereira Pessoa, 1997/08/04
- Re: Sub-swarms,
Ken Cline <=