Contents |
Introduction
To clarify the use of Janus and the implementation of roles as first-class entity, role dynamics and role communication, a short example of a ||:wikipedia:Foraging|Foraging Behavior]] simulation designed using the CRIO metamodel and implemented with the Janus platform is presented.
The ForagerBots demo provides a possible implementation of foragers.
The source code of this demo is embedded into a runnable jar. Just use
java -jar <jarname>in your beloved console to run this demo. Extract this jar to see the associated java source code and use
mvn clean installto compile it (assuming the use of Maven).
Foraging Principle
Consider a foraging scenario: there are a number of food-items randomly scattered in the arena (yellow points). A swarm of robots are searching and retrieving food-items back to the nest. Each food-item collected will deliver an amount of energy to the swarm but the activity of foraging will consume a certain amount of energy at the same time. Generally, more robots engaged in foraging, more food-items the swarm can collect. Moreover, more robots in foraging, more interference among the robots will occur, the robot will take longer to collect a food-item back, as a result, more energy will be consumed. Robots therefore have to switch between foraging and resting in order to maximise the net energy income to the swarm. The challenge is to achieve this with no centralised control and robots with only minimal local sensing and communication ability.
Forager Applet
Download
Binary and Sources
foragerbots-0.5-20120507.220600-347.jar - 52 KB
Sources Only
foragerbots-0.5-20120507.220600-347-sources.jar - 29 KB


