Line data Source code
1 : #include "BatchR.hpp"
2 : #include "clientsim.hpp"
3 : #include <sys/types.h>
4 : #include <unistd.h>
5 : #include <signal.h>
6 :
7 : #include "MultiModel.hpp"
8 :
9 : #include "SPNBase.cpp"
10 : #include "Simulator.cpp"
11 : #include "../ModelGenerator/parameters.hpp"
12 : #include "../ModelGenerator/SimpleSerializer.hpp"
13 : //#include "MarkovChain.hpp"
14 : #include "LHA_orig.cpp"
15 : template class LHA<abstractMarking>;
16 : //template class LHA_orig<abstractMarking>;
17 :
18 21 : int main(int argc, char** argv) {
19 42 : const string tmppath(argv[1]);
20 42 : std::ifstream ifs(tmppath + "/parameters.txt");
21 21 : readParameters(ifs);
22 :
23 21 : signal(SIGINT, signalHandler);
24 21 : signal(SIGHUP, signalHandler);
25 42 : SPN_orig<EventsQueue> N1(0);
26 : //SPN_orig<EventsQueue> N2(N1.tr);
27 : //MarkovChain<EventsQueue> MC;
28 : //MultiModel<EventsQueue,SPN_orig<EventsQueue>,SPN_orig<EventsQueue>> mm(N1,N2);
29 42 : LHA_orig<typename decltype(N1)::stateType> A;
30 42 : Simulator<EventsQueue,typeof N1> sim(N1,A);
31 21 : bool singleBatch = false;
32 21 : sim.SetBatchSize(P.Batch);
33 21 : setSimulator(sim,argc,argv,P);
34 21 : if((P.verbose>=4) | singleBatch )sim.RunBatch();
35 415 : else while( !cin.eof() && P.graceFullEnding <= 1 ){
36 394 : BatchR batchResult = sim.RunBatch(); //simulate a batch of trajectory
37 197 : batchResult.outputR(cout);// output the result on the standart output
38 : }
39 21 : return (EXIT_SUCCESS);
40 63 : }
|