How to define a user function

32 views
Skip to first unread message

Archi Info

unread,
Feb 3, 2019, 12:32:40 PM2/3/19
to GAMA
I would like to define a function with arguments that I can call in the Global part. how to do ?

Srirama Bhamidipati

unread,
Feb 3, 2019, 12:39:05 PM2/3/19
to GAMA
please read about action, function is called an action in GAMA

action action_name(arguments){ .....}

Archi Info

unread,
Feb 3, 2019, 9:44:12 PM2/3/19
to gama-p...@googlegroups.com
Hi,
I'll do it. Thanks

--
You received this message because you are subscribed to the Google Groups "GAMA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gama-platfor...@googlegroups.com.
To post to this group, send email to gama-p...@googlegroups.com.
Visit this group at https://groups.google.com/group/gama-platform.
For more options, visit https://groups.google.com/d/optout.

Archi Info

unread,
Feb 6, 2019, 8:16:58 AM2/6/19
to gama-p...@googlegroups.com
Hi,
I just read the GAMA doc. They say that an action is a capability available to the agents of a species.
I would like to use a function that would have arguments in the init part. I tried the Actions but it does not seem to work.

Srirama Bhamidipati

unread,
Feb 6, 2019, 3:26:16 PM2/6/19
to GAMA
Hi

You must write more about what you did and what did not happen. Your question is too broad and unclear.

Srirama


On Wednesday, February 6, 2019 at 2:16:58 PM UTC+1, Archi Info wrote:
Hi,
I just read the GAMA doc. They say that an action is a capability available to the agents of a species.
I would like to use a function that would have arguments in the init part. I tried the Actions but it does not seem to work.


Le dim. 3 févr. 2019 à 19:06, Archi Info <archii...@gmail.com> a écrit :
>
> Hi,
> I'll do it. Thanks
>
> Le dim. 3 févr. 2019 à 18:39, Srirama Bhamidipati <b.sr...@gmail.com> a écrit :
>>
>> please read about action, function is called an action in GAMA
>>
>> action action_name(arguments){ .....}
>>
>>
>>
>> On Sunday, February 3, 2019 at 6:32:40 PM UTC+1, Archi Info wrote:
>>>
>>> I would like to define a function with arguments that I can call in the Global part. how to do ?
>>
>> --
>> You received this message because you are subscribed to the Google Groups "GAMA" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to gama-platform+unsubscribe@googlegroups.com.

Archi Info

unread,
Feb 7, 2019, 9:10:21 AM2/7/19
to gama-p...@googlegroups.com
Hi,
I tried the examples shown in the gama documentation. When I introduced them in my program, the execution don't work.

What I want to do is like:
init
{
if (condition)  {arg1 <-val1; arg2 <-val2; ...
  function F (arg1, arg2, ...)
 }
else  {
  arg1 <-val3; arg2 <-val4; ...
  F (arg1, arg2, ...)
 }
... 

Le mer. 6 févr. 2019 à 21:26, Srirama Bhamidipati <b.sr...@gmail.com> a écrit :
Hi

You must write more about what you did and what did not happen. Your question is too broad and unclear.

Srirama

On Wednesday, February 6, 2019 at 2:16:58 PM UTC+1, Archi Info wrote:
Hi,
I just read the GAMA doc. They say that an action is a capability available to the agents of a species.
I would like to use a function that would have arguments in the init part. I tried the Actions but it does not seem to work.


Le dim. 3 févr. 2019 à 19:06, Archi Info <archii...@gmail.com> a écrit :
>
> Hi,
> I'll do it. Thanks
>
> Le dim. 3 févr. 2019 à 18:39, Srirama Bhamidipati <b.sr...@gmail.com> a écrit :
>>
>> please read about action, function is called an action in GAMA
>>
>> action action_name(arguments){ .....}
>>
>>
>>
>> On Sunday, February 3, 2019 at 6:32:40 PM UTC+1, Archi Info wrote:
>>>
>>> I would like to define a function with arguments that I can call in the Global part. how to do ?
>>
>> --
>> You received this message because you are subscribed to the Google Groups "GAMA" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to gama-platfor...@googlegroups.com.

>> To post to this group, send email to gama-p...@googlegroups.com.
>> Visit this group at https://groups.google.com/group/gama-platform.
>> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "GAMA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gama-platfor...@googlegroups.com.

Kevin Chapuis

unread,
Feb 8, 2019, 3:42:12 AM2/8/19
to gama-p...@googlegroups.com
Hi,

as Srirama told you, you should give us more about your particular program. If you could share the model you have a problem with, we will be able to help you. Your inline (pseudo) code is too vague and too fare from gaml code to help.

Best,
Kevin
Chapuis kevin
Post-Doc / Research Fellow
IRD, UMI 209 UMMISCO
Gen* ANR project
Reply all
Reply to author
Forward
0 new messages