Skip to content

Commit 9af73fe

Browse files
authored
Here is the basic project setup
* License and simple introductory README file * basic project structure and build files
1 parent fbc4954 commit 9af73fe

9 files changed

+182
-1
lines changed

.gitignore

+10
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,13 @@
2727
*.exe
2828
*.out
2929
*.app
30+
31+
# QtCreator project files
32+
cadmium.config
33+
cadmium.creator
34+
cadmium.creator.user
35+
cadmium.files
36+
cadmium.includes
37+
38+
# Build files
39+
build

BSD-LICENSE.txt

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Copyright (c) 2013-2015, Damian Vicino
2+
Carleton University, Universite de Nice-Sophia Antipolis
3+
All rights reserved.
4+
5+
Redistribution and use in source and binary forms, with or without
6+
modification, are permitted provided that the following conditions are met:
7+
1. Redistributions of source code must retain the above copyright notice,
8+
this list of conditions and the following disclaimer.
9+
2. Redistributions in binary form must reproduce the above copyright notice,
10+
this list of conditions and the following disclaimer in the documentation
11+
and/or other materials provided with the distribution.
12+
13+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
14+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
17+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
23+
POSSIBILITY OF SUCH DAMAGE.

Jamroot.jam

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import os ;
2+
3+
# Note: we require tha BOOST_ROOT be defined with a valid path
4+
BOOST_ROOT = [ os.environ BOOST_ROOT ] ;
5+
ECHO Boost include path is: $(BOOST_ROOT) ;
6+
7+
project simulation
8+
: usage-requirements <include>include
9+
: requirements
10+
<include>$(BOOST_ROOT)
11+
<cxxflags>-pedantic
12+
<cxxflags>-std=c++14
13+
: build-dir ./build
14+
;
15+
16+
# Examples are not being built yet
17+
#build-project example ;
18+
build-project test ;

README.md

+28-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,28 @@
1-
# cadmium
1+
# cadmium
2+
3+
## Introduction
4+
This library provides model classes for multiple Discrete-Event Simulation formalisms and the tools to simulate those models.
5+
This project goal is replace CD++ with a more flexible and better performant implementation. Initial research in the architecture of Cadmium can be found in [Sequential PDEVS architecture](http://cell-devs.sce.carleton.ca/publications/2015/VNWD15/) paper. Our primary building tool is clang, but we also test builds using gcc and visual studio when having the resources to do so.
6+
7+
## Top features
8+
* Model validation at compile time.
9+
* PDEVS models simulated in a single thread.
10+
* Typed messages going through typed ports.
11+
* Time representation is independent of model implementation.
12+
13+
## Quick start
14+
###Requirements
15+
* A C++14 compliant compiler.
16+
17+
### Install
18+
* The library is headers only. Then, it is enough to put the include directory in the path the compiler looks up for them.
19+
20+
### Building tests and examples
21+
* Boost.Test, if running the testsfor running the tests.
22+
* Boost.Build, if using the building files provided for convenience.
23+
24+
## References
25+
* [CD++ website](http://cell-devs.sce.carleton.ca/mediawiki/index.php/Main_Page) is official CD++ website.
26+
* [CD++ paper](http://www.sce.carleton.ca/faculty/wainer/papers/spe482.pdf) describes the CD++ simulator.
27+
* [CDBoost website](http://blincubator.com/bi_library/simulation/?gform_post_id=1390) shows a preliminary implementation of Cadmium.
28+
* [Sequential PDEVS architecture](http://cell-devs.sce.carleton.ca/publications/2015/VNWD15/) describes the architecture originally proposed. Several changes had been implemented since then. The documentation will explain them when ready.

example/Jamfile.jam

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
project exaremple
2+
: requirements
3+
<include>../include
4+
<include>../../safefloat/include
5+
;
6+
7+
8+
exe clock : main-clock.cpp ;

example/main-clock.cpp

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/**
2+
* Copyright (c) 2013-2015, Damian Vicino
3+
* Carleton University, Universite de Nice-Sophia Antipolis
4+
* All rights reserved.
5+
*
6+
* Redistribution and use in source and binary forms, with or without
7+
* modification, are permitted provided that the following conditions are met:
8+
* 1. Redistributions of source code must retain the above copyright notice,
9+
* this list of conditions and the following disclaimer.
10+
* 2. Redistributions in binary form must reproduce the above copyright notice,
11+
* this list of conditions and the following disclaimer in the documentation
12+
* and/or other materials provided with the distribution.
13+
*
14+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17+
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18+
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24+
* POSSIBILITY OF SUCH DAMAGE.
25+
*/
26+
27+
//This file will include the clock example
28+
29+
#include <iostream>
30+
#include <chrono>
31+
#include <algorithm>
32+
33+
using namespace std;
34+
35+
using hclock=chrono::high_resolution_clock;
36+
37+
//This example is the simulation of a clock with 3 needles (H,M,S)
38+
39+
int main(){
40+
auto start = hclock::now(); //to measure simulation execution time
41+
42+
43+
auto elapsed = std::chrono::duration_cast<std::chrono::duration<double, std::ratio<1>>>
44+
(hclock::now() - start).count();
45+
cout << "Simulation took:" << elapsed << "sec" << endl;
46+
return 0;
47+
}
48+

test/Jamfile.jam

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
using testing ;
2+
lib boost_unit_test_framework ;
3+
unit-test test : main-test.cpp [ glob *_test.cpp ] boost_unit_test_framework ;
4+

test/main-test.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#define BOOST_TEST_DYN_LINK
2+
#define BOOST_TEST_MODULE Main
3+
#include <boost/test/unit_test.hpp>

test/pdevs_basic_models_test.cpp

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/**
2+
* Copyright (c) 2013-2015, Damian Vicino
3+
* Carleton University, Universite de Nice-Sophia Antipolis
4+
* All rights reserved.
5+
*
6+
* Redistribution and use in source and binary forms, with or without
7+
* modification, are permitted provided that the following conditions are met:
8+
* 1. Redistributions of source code must retain the above copyright notice,
9+
* this list of conditions and the following disclaimer.
10+
* 2. Redistributions in binary form must reproduce the above copyright notice,
11+
* this list of conditions and the following disclaimer in the documentation
12+
* and/or other materials provided with the distribution.
13+
*
14+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17+
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18+
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24+
* POSSIBILITY OF SUCH DAMAGE.
25+
*/
26+
27+
28+
#define BOOST_TEST_DYN_LINK
29+
#include <boost/test/unit_test.hpp>
30+
31+
BOOST_AUTO_TEST_SUITE( pdevs_basic_models_suite )
32+
33+
BOOST_AUTO_TEST_SUITE( pdevs_accumulator_suite )
34+
BOOST_AUTO_TEST_CASE( it_is_constructable_test )
35+
{
36+
BOOST_ASSERT_MSG(true, "Trivial test passed");
37+
}
38+
BOOST_AUTO_TEST_SUITE_END()
39+
40+
BOOST_AUTO_TEST_SUITE_END()

0 commit comments

Comments
 (0)