Building the examples
Checkout the platform, then build the examples directory:
git clone git://age.iisg.agh.edu.pl/age.git cd age/examples mvn install
While maven downloads the internet, you can check out the structure of the sample applications. They are divided into two maven modules: applications-examples and solutions-examples.
The solutions module contains all the sample code, such as agents, actions and queries. The applications module depends on the solutions one and contain various configuration examples ready to be run.
Running the examples
from Eclipse
Generate Eclipse configuration files by running
mvn eclipse:eclipse
- Import the projects to Eclipse (File -> Import -> Existing project into Workspace) - select both the solutions and applications modules.
- In the applications project, the
src/main/config
directory contains eclipse executables for the different samples. To run any of them, right-click on the specific file and choose Run As and the configurations's name.
from Maven (exec plugin)
Go to the applications-examples directory and use the exec maven plugin:
cd applications-examples mvn exec:java -P examples -Dage.computation.conf=uri_of_config_file
Configuration files for examples can be found in the directories under
/src/main/resources/examples/
, for example:mvn exec:java -P examples -Dage.computation.conf=file:src/main/resources/examples/helloworld/age.xml
It's usually easier to load them from the classpath:
mvn exec:java -P examples -Dage.computation.conf=classpath:examples/helloworld/age.xml
Available examples
Hello World
Strategies
Simple strategy delegation
Configuration
Multiworkplace
Distribution and communication
Monitoring