-
Notifications
You must be signed in to change notification settings - Fork 71
Running instructions
asmkhan edited this page Aug 13, 2015
·
13 revisions
After setting up your machine (see https://github.com/EMLab/emlab-generation/wiki/EMLab-and-Github), you can run EMLab-generation from within SpringSource or from a terminal. The basics are the same: the model is run using maven. SpringSource helps you to execute the necessary maven commands and view the output in the embedded console. The model is operated through the web browser either way.
- Open a terminal
- Go to the emlab shellscript folder (e.g. cd ~/emlab-generation/shellscripts/)
- ONLY ONCE AFTER INSTALLATION: create a "emlabConfig.cfg" file in the shellscripts-folder, based on the TEMPLATE_emlabConfig.cfg file (the file is commented by "#" at the beginning. For standard values if EMLab-Generation is installed in ~/emlab-generation remove these for the last 4 rows).
- COMPILING: type "./compileModel.sh" and press enter in the terminal
- Once per computer start-up: type "./makeRamdisk.sh" and press enter
- RUNNING: type "./startModel.sh" and press enter. Wait until the terminal shows the following line "WARN Default agentspring url http://localhost:8080/agentspring-face/", than open a new terminal (or new terminal tab using CTRL+SHIFT+T) and type "./startAgentSpring.sh" to start Agentspring. Open your browser and go to "http://localhost:8080/agentspring-face/". The model (with ./startMode.sh can be stopped, compiled and restarted, without restarting Agentspring, as long as the process is running that was started using ./startAgentSpring.sh)
- STOPPING: To stop any process in the terminal at any time press "CTRL+C"
Setup and compile
- Open a terminal.
-
Optional For fast runs you can use a ramdisk (
mkdir /tmp/ramdiskand thensudo mount -t tmpfs -o size=512M tmpfs /tmp/ramdisk/). For Mac:
export MAVEN_OPTS="-d64 -server -Xmx2048m" diskutil erasevolume HFS+ "ramdisk" `hdiutil attach -nomount ram://1165430` ln -s /Volumes/ramdisk /tmp/ramdisk
- Go into the emlab-generation folder. We assume the location is in the home folder. (
cd ~/emlab-generation). - Compile and install AgentSpring (
cd ~/emlab-generation/AgentSpringandmvn clean install). You only have to do this once. - Compile the model (
cd ~/emlab-generationandmvn clean install).
Running
- Start the model (
cd ~/emlab-generation/emlab-generationandmvn exec:java). You should see a warning with the location to work with the model in your browser, which is http://localhost:8080/agentspring-face/ - Open a second terminal
- Run AgentSpring's interface (
cd ~/emlab-generation/AgentSpring/agentspring-faceandmvn jetty:run). You only have to do this again after restarting the computer. Leave this terminal running in the background. - Open your browser at http://localhost:8080/agentspring-face/ and have fun!
- You can stop the model by pressing CTRL C (breaking the process) in the first terminal. Afterwards you can restart it there with
mvn exec:java.
Essentially, you need to start the same two processes as in the description above: one for the model and one for AgentSpring. I suggest to use SpringSource to run the model and a terminal to run AgentSpring and wrote the description accordingly.
Setup
- Open a terminal.
-
Optional For fast runs you can use a ramdisk (
mkdir /tmp/ramdiskand thensudo mount -t tmpfs -o size=512M tmpfs /tmp/ramdisk/) - Go into the emlab-generation folder. We assume the location is in the home folder. (
cd ~/emlab-generation). - Compile and install AgentSpring (
cd ~/emlab-generation/AgentSpringandmvn clean install). You only have to do this once.
Compile and run the model
- Start SpringSource
- Right-click on the EMLab-generation project in the package explorer, Run as, Maven build...
- In Goals, type:
clean install exec:java. - Optional once everything runs fine, you can select offline and skip tests to speed up the process.
-
Optional if you did not make changes to the code, you can omit the goals clean install to speed up the process even further. When doing the maven build, in Goals, type:
exec:java. - You can break the process with the red stop button.
Run AgentSpring
- Open a terminal
- Run AgentSpring's interface (
cd ~/emlab-generation/AgentSpring/agentspring-faceandmvn jetty:run). You only have to do this again after restarting the computer. Leave this terminal running in the background. - Open your browser at http://localhost:8080/agentspring-face/ and have fun!