[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Sub-swarms
From: |
Ken Cline |
Subject: |
Re: Sub-swarms |
Date: |
Wed, 25 Feb 1998 08:03:09 -0500 (EST) |
Paul,
I do vaguely remember this, and no, I don't think my advice
works. I didn't try implementing the reset functionality as
I described below but I did try something similar. After
several days of countless failures I shelved to work as
extra functionality to completed at some later date (ie
catagory: "Bell or Whistle").
As I recall, I could never get the schedules/activities to
die quietly; I have a nack for making them core dump :).
Anyway, in Sept. we started work on a different model and
implementing a reset hasn't been an issue yet (ie runs are
typically done in batchmode, with multi-run "studies" setup
with a Java applet, ala Drone).
Sorry I can't be more helpful.
Ken.
PS: I seem to recall Vinicius was able to get something
working. Vinicius?
On Tue, 24 Feb 1998, Paul Johnson wrote:
> Dear Ken:
> Do you remember this? I wonder if you think your advice works.
>
> Now I'm grepping through the swarm list trying to fill out answers to a
> list of programming FAQs that Rick Riollo and a few others have helped me
> formulate. One question I certainly want to answer is "How can I make my
> simulation run over and over again," and your comments here are, as usual,
> excellent and understandable. I just wondered if they are "up to date"
>
>
> On 05-Aug-97 Ken Cline wrote:
> >
> > 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
> >
> >
> ----------------------------------
> E-Mail: Paul Johnson <address@hidden>
> Date: 24-Feb-98
> Time: 23:53:23
>
> This message was sent by XFMail
> ----------------------------------
>
_________________________________________________________
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.
================================