summaryrefslogtreecommitdiff
path: root/core/test_sim_loop.cpp
blob: c17f796b67ada1607eb2feaee35ff9f856ae3b1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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