[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Swarm-Support] sending messages with parameters in ModelSwarm
From: |
gepr |
Subject: |
Re: [Swarm-Support] sending messages with parameters in ModelSwarm |
Date: |
Wed, 12 Mar 2003 09:32:33 -0800 |
Eliezer Gurarie writes:
> I am a new Swarm user with a quick tactical programming question: Can I
> send a message in my Actionlist that depends on a parameter?
>
> In my Action list I would like to perform a "rearrangement" of a
> Discrete2D object "preyspace" - based on a paramater "preyProb" like so:
> *
> [modelActions createActionTo: preyspace message: M(rearrange:
> preyProb)]*;
>
> where "rearrange" is a standard method that takes a float "p":
> *- rearrange: (float)p*
>
> the compiler responds with: *ModelSwarm:133: parse error before
> before: ")" *
>
> Does Swarm just inherently forbid passing methods with parameters in the
> ActionList? Do I have to define the rearrange somewhere earlier (though
> it feels like this is the most natural place to tell it to do the
> rearrange?)
>
If I understand what you're asking, check out:
http://www.swarm.org/swarmdocs/set/swarm.activity.actioncreatingto.protocol.html
The syntax should be something like:
[modelActions createActionTo: preyspace message: M(rearrange:) : preyProb];
Don't forget the ":" inside the "M" macro...
--
glen e. p. ropella =><= Hail Eris!
H: 503.630.4505 http://www.ropella.net/~gepr
M: 831.247.7901 http://www.tempusdictum.com