In order to install and use the AgE
platform, all you need is some basic knowledge of maven.
Generate a new project
The easiest way to quickly set up your own AgE
projects is to use one of our maven archetypes. Simply paste the following into your command line:
mvn archetype:generate -DarchetypeCatalog=http://age.iisg.agh.edu.pl/maven2/
You will be asked to chose an available archetype. Right now, the only one is a simple helloworld example:
Choose archetype: 1: http://age.iisg.agh.edu.pl/maven2/ -> org.jage.archetypes:helloworld (jAgE helloworld archetype) Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 1
All that is left is to specify the attributes of your maven project and choose a version of AgE
to use (or let a default be chosen):
Define value for property 'groupId': : com.company Define value for property 'artifactId': : project Define value for property 'version': 1.0-SNAPSHOT: : Define value for property 'package': com.mycompany: : [INFO] Using property: jage-version = 2.6.0 Confirm properties configuration: groupId: com.mycompany artifactId: test version: 1.0-SNAPSHOT package: com.mycompany jage-version: 2.6.0 Y: : Y
A new project have been generated in the directory project
You can also paste the following one-liner:
mvn archetype:generate -B -DarchetypeCatalog=http://age.iisg.agh.edu.pl/maven2/ -DarchetypeGroupId=org.jage.archetypes -DarchetypeArtifactId=helloworld -DgroupId=com.company -DartifactId=project -Dversion=1.0-SNAPSHOT -Djage-version=2.6.0
Project Layout
The layout of the generated project is as follows:
project |-pom.xml |-applications |pom.xml |-src/main/resources |-base.xml |-helloworld.xml |-log4j.xml |-solutions |-pom.xml |-src/main/java/com/mycompany/ |-HelloWorldSimpleAgent.java
An Age project consists of two modules:
- The
solution
module contains all your code: custom agents, actions, strategies, etc. - The
applications
module contains the configuration of your computations.
All the dependencies between these modules and the AgE
platform are described in the corresponding pom
files and are handled by maven. You can also put any common maven configuration in the root pom
of the project.
Building the project and starting the computation
In order to build the project, simply run the install
maven goal in the root directory of the project:
cd project mvn install
The computation can be easily started using the exec
maven plugin. Go into the applications
directory and run the following:
cd applications mvn -q exec:java