Simulation with external service communication?

53 views
Skip to first unread message

Enrico Rotundo

unread,
Jan 9, 2017, 7:49:22 AM1/9/17
to GAMA
Hi all, I'm considering to use GAMA for a simulation project where I have agents in a simple environment (e.g., library) that get suggested tasks by a recommender system (have a break, socialise, etc.).
To do so, I'd need GAMA communicate with an external/recommender service that will be implemented in Java or as an HTTP API.
In particular, I'd need the following:
  • agents stream their data (position, activity, nr. steps, etc.) to an external service
  • agents take autonomous decisions considering their willing as well as suggested tasks from the external service
Is this feasible using GAMA?

ps: although there are similar questions it'd be nice to have an updated discussion here :)

Benoit Gaudou

unread,
Jan 9, 2017, 7:58:00 AM1/9/17
to gama-p...@googlegroups.com
Dear Enrico Rotundo,

I am happy you are interested in the GAMA platform.

Basically, nothing prevents you to do what you want to do!
Nevertheless, you will need to extend GAMA in order for your GAMA agents to interact with you recommender service.
For example, if the recommender service is a java library/application, you will have to create a new java plugin in order to create new GAML keyword for your agents to interact with your service.
You have all your need in the documentation here : https://github.com/gama-platform/gama/wiki/DevelopingExtensions .

The GAML language is mainly composed of statements and operators.
The simplest way to extend the language is to create new operators (quiet equivalent to functions), that can call methods on your service.
Note that the creation of an operator only need to add some java annotations to a java method.

If you need more specific helps, do not hesitate to send more questions.

Best Regards

Benoit Gaudou


--
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.
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.

Enrico Rotundo

unread,
Jan 9, 2017, 8:43:59 AM1/9/17
to GAMA
Thanks, that's what I was looking for!
What can you tell me about HTTP communications? I guess I'd need a Java plugin that can operate with HTTP and translate answers to something GAMA can understand, is that right?

Best,
Enrico  


On Monday, January 9, 2017 at 1:58:00 PM UTC+1, Benoit Gaudou wrote:
Dear Enrico Rotundo,

I am happy you are interested in the GAMA platform.

Basically, nothing prevents you to do what you want to do!
Nevertheless, you will need to extend GAMA in order for your GAMA agents to interact with you recommender service.
For example, if the recommender service is a java library/application, you will have to create a new java plugin in order to create new GAML keyword for your agents to interact with your service.
You have all your need in the documentation here : https://github.com/gama-platform/gama/wiki/DevelopingExtensions .

The GAML language is mainly composed of statements and operators.
The simplest way to extend the language is to create new operators (quiet equivalent to functions), that can call methods on your service.
Note that the creation of an operator only need to add some java annotations to a java method.

If you need more specific helps, do not hesitate to send more questions.

Best Regards

Benoit Gaudou

2017-01-09 13:49 GMT+01:00 Enrico Rotundo <enrico....@gmail.com>:
Hi all, I'm considering to use GAMA for a simulation project where I have agents in a simple environment (e.g., library) that get suggested tasks by a recommender system (have a break, socialise, etc.).
To do so, I'd need GAMA communicate with an external/recommender service that will be implemented in Java or as an HTTP API.
In particular, I'd need the following:
  • agents stream their data (position, activity, nr. steps, etc.) to an external service
  • agents take autonomous decisions considering their willing as well as suggested tasks from the external service
Is this feasible using GAMA?

ps: although there are similar questions it'd be nice to have an updated discussion here :)

--
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.

Benoit Gaudou

unread,
Jan 9, 2017, 8:58:26 AM1/9/17
to gama-p...@googlegroups.com
You're right!
Basically you should be able to have a Java object able to communicate with the HTTP server and then link it to the agent.

On this last point, perhaps the use of function is not enough and you will need some objects that can persist all along the simulation.
To this purpose you can look at the creation of a skill or an agent architecture, which will add to agent to capability to have additional attributes.

In GAMA, it is possible to connect agents to a database to store and retrieve data, through a skill (or a species).
This could be quiet similar for a connection to an HTTP server.

Cheers

Benoit
 

To unsubscribe from this group and stop receiving emails from it, send an email to gama-platform+unsubscribe@googlegroups.com.

Patrick Taillandier

unread,
Jan 9, 2017, 9:26:15 AM1/9/17
to gama-p...@googlegroups.com
Hi,

You can use for that the "network" skill that allows GAMA to communicate with a client/server. Unfortunately, I was not able to find the documentation about this skill, but you have a lot of example models that are provided with the platform: Plugin models -> Network.

Cheers,

Patrick

Harshal Hayatnagarkar

unread,
Jan 19, 2017, 7:15:37 AM1/19/17
to GAMA
Hi,

Am interested in similar functionality but in a different context. Can we 'simply drop-in a .jar' file and load a class from within GAMA instead of a larger round-trip Eclipse plugin-based development? Something similar to 'asm' keyword of C/C++. Just a thought.

With regards,
Harshal

Amith Kumar

unread,
Oct 20, 2017, 11:42:45 AM10/20/17
to GAMA
Hi There,

Have you managed to comuncate with the external service? if yes plese let me know about the procedures. I would like to establish the communication between GAMA and prlog. I really have no clue, this is even possible or not!!

Cheers,
Amith
Reply all
Reply to author
Forward
0 new messages