2D Cargo Agent Simulator
Agentology is a 2D cargo agent simulator designed for educational purposes.
If you encounter any bugs or miss a feature, please report to max@maxbuegler.eu. |  |
Download
Agentology source package 0.7 (9.4 KB)
Agentology source package 0.6 (8.1 KB)
Licensed under GNU GENERAL PUBLIC LICENSE Version 3
Documentation
What does Agentology do?
Agentology is a java based framework that provides a simulation environment to experiment with different types of agents. The agents have to unload cargo from a container and load them into the storage area. In order to make it easier or harder for the agents different scenarios can be designed. The aim is to develop an agent that will unload the cargo as fast as possible.
Who can use Agentology?
In order to use agentology you should have basic knowledge about the java programming language.
How does Agentology work?
When starting a new simulation the world is initialized according to the scenario defined in the launcher class. The selected number of agents will then be initialized by repeatedly calling the getInstance(...) method of the agent class.
The simulation is then executed stepwise. At each step (1 timeunit) each agent gets the chance to do something which means every agent gets a call on the doSomething() method.
At this point the agent has the chance to perform at max one action.
In order to communicate agents can broadcast messages which will be received by all agents or send messages to single agents. Each agent is assigned an unique ID.
Message sending and querying information from the environment is not limited.
- agents can not pass Walls.
- agents can go below a package to pick it up (unless they are carrying a package), but not go from below one package to below another.
- agents may perform at max one action (also if it fails) each time the doSomething() method is called.
- agents can query as much information as they want.
- agents can send and receive as many messages as they want.
Broadcast messages are output into the console.
Agentology is not multi-threaded, so you don't have to care about your code being thread safe.
When a simulation is finished the results of the simulation are displayed in a messagebox.
Recorded information is:
- elapsed time
- consumed fuel (1 move means 1 fuel unit)
- number of broadcast messages.
How to setup Agentology on your computer?
- Make sure you have a java software development kit (jdk) installed.
- If you like install an java IDE of your choice (like eclipse or intellij IDEA)
- Download the Agentology source package
- Extract it to an empty folder
- If you use an IDE setup a new project from the extracted source folder, otherwise you have to compile Agentology manually.
- You can now run Agentology by either launching mainGraphical.java or mainText.java in the Launchers Package
For easy working with the source files a java integrated development environment (IDE) like Eclipse, NetBeans or IntelliJ IDEA is recommended.
What does the graphical output mean?
- Colored squares are boxes.
- Circles are agents.
- Circles with black dots in the center are agents carrying boxes.
- Green rectangle is pick up area.
- Red rectangle is drop off area.
- Gray areas are walls.
How to create your own scenarios?
Scenarios are defined in the Scenarios package. The Scenario interface looks like this:
An example scenario ExampleScenario.java is also contained in that package.
You can also load scenarios from comma separated data using CommaSeparatedScenario.java
How to create your own agent?
An agent is basically a single java class implementing the Agent.java interface and being provided with the interface AgentController.java to control the agent in the environment.
Agentology is not multi-threaded, so you don't have to care about your code being thread safe.
The package contains two simple example implementations located in the Agents package.
DumbAgent.java and BetterAgent.java . Have a look at those classes for further information.
In order to increase difficulty methods can be removed from the AgentController interface
How to start a simulation?
In the top lines of the main method in the launcher classes MainGraphical.java and MainText.java you can select the agent class and the scenario to use. Afterwards execute the class.
You will find more information in the comments of the source files.