Skip to content

faq 255983617

Billy Charlton edited this page Sep 5, 2018 · 2 revisions

agent communication

by youssef on 2018-04-01 00:55:53


Hi all,

I want to know if there is an extension of MATsim that allows the agents to communicate (an agent send a simple string message to another agent for example)


Comments: 2


Re: agent communication

by Kai Nagel on 2018-04-10 07:34:33

There is no easy, straightforward way. Reason is that we need to be computationally efficient, and so MATSim agents are relatively stupid. (This sometimes causes discussion if the MATSim synthetic travellers are "agents" at all, but most people seem to agree that they are indeed agents, albeit, as said, not very capable ones.)

From here on, it depends what you want to do. Our "events" channel can also be used by user code, with user-defined events. https://github.com/matsim-org/matsim-code-examples/tree/0.10.x/src/main/java/tutorial/scoring/example16customscoring points to an example how to generate, throw, and catch events. This would be enough if the agents just want to communicate, but not change their actions based on the communication. Note, however, that if all agents listen to all events, this approach becomes computationally too expensive for large scale simulations (which is, indeed, the reason why such a feature as you want is not easily available in MATSim).

If, however, agents indeed want to change their actions based on the communication, one would need to influence their behavior. https://github.com/matsim-org/matsim-code-examples/tree/0.10.x/src/main/java/tutorial/withinday shows two ways how to achieve this. There is also a DynAgent class in a contrib, but the maintainer of that contrib should talk for himself.

There is also https://github.com/agentsoz/bdi-abm-integration , which couples a BDI (belief desire intention) system to MATSim.


Re: agent communication

by youssef on 2018-04-18 14:09:39

Thank you Mr Nagel, for me after the communication, i want that the agents change their actions, that's why i can't use "events" channel, and after reading about the Bdi integration, i think it will be the solution to add some intelligence to MATSim agents, and help them to communicate and change their actions using the withinday replanning after that. I already started working on that, so if you have some advises that will help me i'll be thankful.

Clone this wiki locally