swarm-support
[Top][All Lists]
Advanced

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

freedom using Activity


From: David Aliaga
Subject: freedom using Activity
Date: Tue, 9 May 2000 02:09:33 -0700 (PDT)

Hello Swarm community.
I would like to share my questions here and listen
what you have to say.
I am new with Swarm and I am doing my first
simulations using it. Until now I have programmed
mainly in C cause it's been my favourite languaje. But
now since my research is about agents I feel that
swarm and  ObjC  is quite useful.

To the point, I have a simulation written in C and I
am now translating it into Swarm. But I would like to
write using the Swarm style and philosophy.The problem
is I feel limitations in the "Activity" part of the
coding.

For example. In C-style I have this

Run_simulation()
{
  Initialize_positions();

  while( not condition)
    {
      Execute_trials();
      Move_some_positions(); 
     }
}

Execute_trials()
{
   while(alive)
   {
     agents_do_A();
     agents_do_B();
     agents_do_C();   
}

That means that I do Execute_trials until the agent
"die", then change something and run again the trial.
I have no idea how to implement these 2 levels in
swarm, especially because in the examples the agents
seem to live "forever"
I can make some code to accomplish what I want but I
feel its forced and not natural, for example:

mact=[actionGroup create:self];
[mact createActionForEach: agentlist message:
M(action_A)];
[mact createActionForEach: agentlist message:
M(action_B)];
[mact createActionForEach: agentlist message:
M(action_C)];
[mact createActionForEach: agentlist message:
M(verify_if_alive)];
[mact createActionForEach: agentlist message:
M(move_something_if_dead)];

and then put mact in schedule but I still feel it is
not the swarm way forcing 2 levels into one. any
opinion.

Thank You

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]