-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain_body.cpp
77 lines (36 loc) · 1.12 KB
/
main_body.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
int main(int argc, char * argv[]) {
if(argc<2) {
program_statement(argv[0]);
return -1;
}
if(paras._set_(argc, argv)==false)
return -1;
paras.print();
string netfile=paras.file1;
{ /* check if file_name exists */
char b[netfile.size()+1];
cast_string_to_char(netfile, b);
ifstream inb(b);
if(inb.is_open()==false) {
cout<<"File "<<netfile<<" not found"<<endl;
return false;
}
} /* check if file_name exists */
oslom_net_global luca(netfile);
if(luca.size()==0 || luca.stubs()==0) {
cerr<<"network empty"<<endl;
return -1;
}
LOG_TABLE._set_(cast_int(luca.stubs()));
char directory_char[1000];
cast_string_to_char(paras.file1, directory_char);
char char_to_use[1000];
sprintf(char_to_use, "mkdir %s_oslo_files", directory_char);
int sy=system(char_to_use);
sprintf(char_to_use, "rm -r %s_oslo_files/*", directory_char);
sy=system(char_to_use);
cout<<"output files will be written in directory: "<<directory_char<<"_oslo_files"<<endl;
//luca.draw_with_weight_probability("prob");
oslom_level(luca, directory_char);
return 0;
}