summaryrefslogtreecommitdiff
path: root/core/test_sim_loop.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/test_sim_loop.cpp')
-rw-r--r--core/test_sim_loop.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/core/test_sim_loop.cpp b/core/test_sim_loop.cpp
new file mode 100644
index 0000000..c17f796
--- /dev/null
+++ b/core/test_sim_loop.cpp
@@ -0,0 +1,28 @@
+#include <boost/mpl/list.hpp>
+#include <boost/mpl/pair.hpp>
+#include <iostream>
+
+#include "sim_loop.hpp"
+
+#include "model.hpp"
+
+using namespace std;
+
+int main() {
+ using boost::mpl::pair;
+ using boost::mpl::list;
+
+ SimLoop<Lists::all> sim;
+
+ // run, exceeding time limit
+ assert(sim.run(0.05, 1000000));
+ cout << "left sim.run at " << sim.queues.min()()
+ << " (" << (int) sim.queues.minType() << ")" << endl;
+
+ // run, execeeding event limit
+ assert(sim.run(1000, 1) == 0);
+ cout << "left sim.run at " << sim.queues.min()()
+ << " (" << (int) sim.queues.minType() << ")" << endl;
+
+ return 0;
+}
contact: Jan Huwald // Impressum