Commit c031d9a2 authored by Evgeny Kusmenko's avatar Evgeny Kusmenko
Browse files

Merge branch 'hengwen' into 'master'

Added scripts and instructions for Mac/Linux users

See merge request !1
parents d405634d 8eab07cc
......@@ -16,9 +16,15 @@
__NOTE:__ _MontiSim_ is the directory, in which MontiSim-belonging projects should be clonned. It has to be manually created.
## Usage:
* go to `scripts` folder
* run `main.bat` __from there__ i.e. the script assumes that the working directory is `scripts`
Go to `scripts` folder
* For Windows users:
* run `main.bat` __from there__ i.e. the script assumes that the working directory is `scripts`
* For Mac/Linux users:
* edit the `JAVA_HOME` in `linux/variables.sh` to fit your machine.
* run `linux/generate.sh` and then `linux/compile.sh` __from there__.
Available one can find a [video example](https://github.com/MontiSim/EMAM-showcase/releases/download/webapp/example1.mp4) of using the model.
## What's under the hood:
......@@ -39,3 +45,5 @@ The AutoPilot is desined to calculate simulation frames until a timeout expires,
In environment of shared simulator, which serves many simulations, such timeout cannot be used, thus either a _simulationDone_ flag has to be provided by the model or _lastNavigationTarget_ node has to be available.
In the distributed simulator, which is such an environment, the AutoPilot behaviour results into a non-stopping simulation, thus the simulation buffer used to store simulation frames is constantly kept full, until a user stops the scenario simulation.
JAVA_HOME = "/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home"
\ No newline at end of file
#!/bin/bash
source ./variables.sh
g++ -shared -fPIC \
-I $JAVA_HOME/include/ \
-I $JAVA_HOME/include/darwin \
-I $ARMADILLO_HOME/include \
-o $AUTOPILOT_DLL_DIR/AutopilotAdapter.dll \
$AUTOPILOT_CPP_DIR/AutopilotAdapter.cpp \
#!/bin/bash
source "./variables.sh"
java -jar $AUTOPILOT_HOME/emam2cpp.jar \
--output-dir=$AUTOPILOT_CPP_DIR \
--models-dir=$AUTOPILOT_HOME/model \
--root-model=de.rwth.armin.modeling.autopilot.autopilot \
--flag-use-armadillo-backend \
--flag-generate-autopilot-adapter
\ No newline at end of file
cd ../..
AUTOPILOT_HOME="$(pwd)"
mkdir -p $AUTOPILOT_HOME/cpp
mkdir -p $AUTOPILOT_HOME/dll
# Replace it with your machine's java home path
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home
SIMULATION_URL=http://localhost:8080/
TOMCAT_HOME=$AUTOPILOT_HOME/apache-tomcat-9.0.5
MINGW_HOME=$AUTOPILOT_HOME/mingw64
ARMADILLO_HOME=$AUTOPILOT_HOME/armadillo-8.400.0
AUTOPILOT_CPP_DIR=$AUTOPILOT_HOME/cpp
AUTOPILOT_DLL_DIR=$AUTOPILOT_HOME/dll
pushd %~dp0
cd ..
cd ../..
set AUTOPILOT_HOME=%CD%
popd
set SIMULATION_URL=http://localhost:8080/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment