The SyDEVS C++ library provides a framework for implementing complex systems simulation code in a modular and hierarchical fashion.
The framework combines three modeling paradigms: discrete event simulation, agent-based modeling, and dataflow programming. The discrete event simulation aspect is based on DEVS, a well-regarded modeling formalism involving two types of models that correspond with the atomic and composite nodes of SyDEVS. SyDEVS also includes collection nodes, which extend DEVS with agent-based modeling capabilities, and function nodes, for dataflow programming. Atomic, composite, collection, and function nodes communicate through flow ports as part of a dataflow programming network. Atomic, composite, and collection nodes also communicate in a DEVS-like fashion through message ports.
In addition to supporting multiple modeling paradigms, the SyDEVS library provides comprehensive and reusable Modern C++ implementations of multidimensional arrays, Standard International (SI) units, a multiscale time representation, and other technical computing elements.
The main SyDEVS website is at https://autodesk.github.io/sydevs.
The SyDEVS API reference is at https://autodesk.github.io/sydevs/doc/html.
The recommended way to use SyDEVS in a simulation project is to include the latest release as an external library, as described in the Getting Started tutorial.
To build the SyDEVS examples and tests using CMake and Visual Studio 2022, follow the instructions below.
- Open a command prompt and navigate to the
sydevs
project directory. mkdir build
cd build/
cmake -G "Visual Studio 17 2022" -A x64 ..
- Open
build/SyDEVS.sln
in Visual Studio - Recommendation: In
Tools -> Options -> Text Editor -> C/C++ -> Tabs
, selectInsert spaces
with aTab size
andIndent size
of4
To build the SyDEVS examples and tests using CMake and TDM-GCC, follow the instructions below.
- Install the 64+32-bit MinGW-w64 edition of TDM-GCC.
- Open a command prompt and navigate to the
sydevs
project directory. mkdir bin
cd bin/
cmake -G "MinGW Makefiles" ..
mingw32-make
Unit and regression tests are run automatically during the build process.
The unit testing framework used in SyDEVS is Catch2. See the documentation for a tutorial and reference material. Catch2 is released under the Boost Software License 1.0.
Note that the complete set of regression tests will only run if MSVC is used. If another compiler is used, the regression tests involving random distributions will be skipped, since different compilers are expected to generate different random samples.
To build or update the documentation files with Doxygen, make sure you are in the top level directory where doxygen.config is located, and execute the following command:
doxygen doxygen.config
This will build the documentation in the doc
directory. To view the documentation, go to docs/html
and open index.html
in your web browser.
You should update the documentation on a regular basis to keep it in sync with the code.
When releasing a new version of SyDEVS, remember to perform the following steps:
- In doxygen.config, update the
PROJECT_NUMBER
. - Ensure the change above is merged into the
main
branch of the repo. - Create the new release.
- Generate the API documentation, and copy the contents of
doc/html
. - Checkout the
gh-pages
branch of the repo. - In the
gh-pages
branch, replace the contents ofdoc/html
with the contents copied above.
The Main SyDEVS Website includes an Overview, a Getting Started tutorial, a User Manual, and the API Reference for the latest release.
Examples of SyDEVS-based simulations are found in the src/examples
directory.
The best examples for learning the library are those in demo
.
In particular, the queueing
project features one well-commented example of each of the four main types of nodes:
queueing_node.h
(atomic)two_stage_queueing_node.h
(composite)parallel_queueing_node.h
(collection)plus_node.h
(function)
Review the contributing guidelines before you consider working on SyDEVS and proposing contributions.
SPDX-License-Identifier: Apache-2.0