Browse Source

Added xDEVS Rust

Román Cárdenas 3 years ago
parent
commit
a37986d9d1
4 changed files with 31 additions and 18 deletions
  1. 3 0
      .gitmodules
  2. 4 4
      devstone_comparative.py
  3. 23 14
      setup.sh
  4. 1 0
      simulators/xdevs.rs

+ 3 - 0
.gitmodules

@@ -18,3 +18,6 @@
 [submodule "simulators/cadmium_v2"]
 	path = simulators/cadmium_v2
 	url = https://github.com/SimulationEverywhere/cadmium_v2.git
+[submodule "simulators/xdevs.rs"]
+	path = simulators/xdevs.rs
+	url = https://github.com/iscar-ucm/xdevs.rs.git

+ 4 - 4
devstone_comparative.py

@@ -34,14 +34,14 @@ COMMANDS = {
         },
     },
     "xdevs": {
-        "c++": "simulators/xdevs-c++/src/xdevs/examples/DevStone/DevStone -w {width} -d {depth} -b {model_type} -m 1",
-        "go": ,
+        "cpp": "simulators/xdevs-c++/src/xdevs/examples/DevStone/DevStone -w {width} -d {depth} -b {model_type} -m 1",
+        # "go": ,  # TODO add this
         "java": {
             "sequential": "java -classpath simulators/xdevs-java/out/ xdevs.core.devstone.DEVStone {model_type} {depth} {width} {int_cycles} {ext_cycles} coord false",
             "parallel": "java -classpath simulators/xdevs-java/out/ xdevs.core.devstone.DEVStone {model_type} {depth} {width} {int_cycles} {ext_cycles} parallel false",
         },
-        "python": "python3 simulators/xdevs-python/perfdevs/examples/devstone/main.py -m {model_type} -d {depth} -w {width} -i {int_cycles} -e {ext_cycles}",
-        "rs": ,
+        "py": "python3 simulators/xdevs-python/perfdevs/examples/devstone/main.py -m {model_type} -d {depth} -w {width} -i {int_cycles} -e {ext_cycles}",
+        "rs": "cargo run --release --manifest-path simulators/xdevs.rs/Cargo.toml {model_type} {width} {depth} {int_cycles} {ext_cycles}",
     },
 }
 

+ 23 - 14
setup.sh

@@ -6,22 +6,28 @@ cd simulators/cadmium
 git checkout b6636f791d3fbff41b6b72e1d9e34ce18152065d
 # Set up Cadmium v2 repository
 cd ../cadmium_v2
-git checkout devel # TODO set to a release tag when available
+git checkout devel # TODO set to a specific commit when available
 # Set up CDBoost repository
 cd ../cdboost
 git checkout 6c5f4a457745a5da4f9bf2ddc5a5d46ff4f78fa2
+# Set up PythonPDEVS repository
+cd ../pythonpdevs
+git checkout 190a70532a96a76445b007c4e0f9cb5a4ce03e55
+cd ../..
+# Set up xDEVS C++ repository
+# cd ../xdevs-c++
+# git checkout bdb8c72dc25d7793665e7146b9d17f70b5a12db0
+# TODO xDEVS Go
 # Set up xDEVS Java repository
 # cd ../xdevs-java
 # git checkout a180827f9bdfc3f44d9f1cc207294d8552e2882d
 # Set up xDEVS Python repository
 # cd ../xdevs-python
 # git checkout e578d581452394556bb0a85f03f5427fd5e72857
-# Set up xDEVS C++ repository
-# cd ../xdevs-c++
-# git checkout bdb8c72dc25d7793665e7146b9d17f70b5a12db0
-# Set up PythonPDEVS repository
-cd ../pythonpdevs
-git checkout 190a70532a96a76445b007c4e0f9cb5a4ce03e55
+# Set up xDEVS Rust repository
+cd ../xdevs.rs
+git checkout 9105a2ebbfb176c7333e3765ac2c79d52a2cc03b
+# Go back to root directory
 cd ../..
 
 # COMPILE THE DEVSTONE PROJECT FOR ALL THE DIFFERENT ENGINES
@@ -41,7 +47,13 @@ cmake --build build/ --target devstone
 cd ../../simulators/cadmium_v2
 cmake -S . -B build/ -D CMAKE_BUILD_TYPE=Release
 cmake --build build/ --target main_devstone parallel_main_devstone
-
+# build PythonPDEVS
+cd ../pythonpdevs/src
+python3 setup.py install --user
+# Set up xDEVS C++ project
+# cd ../../xdevs-c++/src/xdevs/examples/DevStone/
+# make
+# TODO xDEVS Go
 # Compile xDEVS java
 cd ../../simulators/xdevs-java
 find -name "*.java" | grep src/* > sources.txt
@@ -49,9 +61,6 @@ javac @sources.txt -encoding ISO-8859-1 -d out
 # build xDEVS Python
 cd ../xdevs-python
 python3 setup.py install
-# build PythonPDEVS
-cd ../pythonpdevs/src
-python3 setup.py install --user
-# Set up xDEVS C++ project
-# cd ../../xdevs-c++/src/xdevs/examples/DevStone/
-# make
+# Compile DEVStone for xDEVS Rust
+cd ../xdevs.rs
+cargo build --release

+ 1 - 0
simulators/xdevs.rs

@@ -0,0 +1 @@
+Subproject commit 9105a2ebbfb176c7333e3765ac2c79d52a2cc03b