-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.cpp
51 lines (40 loc) · 885 Bytes
/
main.cpp
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include "main.h"
string Main::getError( int num ){
string error = "[ERROR]";
switch(num){
case 1:
error += " Less than 2 arguments, the execution must be ./main config/[conf_file].txt";
break;
default:
error += " undefined";
break;
}
return error;
}
string Main::getPlan(){
ifstream ifs_sas( "sas_plan" );
if( ifs_sas ){
ifs_sas.close();
return "sas_plan";
}
ifs_sas.close();
for( int i = 10; i > 0; i-- ){
string sas_plan = "sas_plan." + to_string( i );
ifstream ifs( sas_plan.c_str() );
if( ifs ){
ifs.close();
return sas_plan;
}
ifs.close();
}
return "";
}
string Main::getPlannerCommand( unsigned timeout ){
return "./scripts/planners/planner.sh " + dest_domain + " " + dest_ins + " " + to_string( timeout );
}
int main( int argc , char *argv[] ){
Main *m = new Main( argc, argv );
m->run();
if( m ) delete m;
return 0;
}