cppyabm
1.0.17
An agent-based library to integrate C++ and Python
examples
Cpp
build
_deps
cppyabm-src
examples
cpp
cpp_main.cpp
Go to the documentation of this file.
1
#include <iostream>
2
#include "
cpp_example.h
"
3
#include <chrono>
4
using namespace
std;
5
int
main
(
int
argc,
char
** argv){
6
if
(argc>2){
7
cerr<<
"More than one argument is given"
<<endl;
8
exit(2);
9
}
10
bool
output_flag
;
11
12
output_flag
= argv[1];
13
14
std::chrono::steady_clock::time_point
begin
= std::chrono::steady_clock::now();
15
auto
envObj
= make_shared<Domain>(
output_flag
);
16
envObj
->setup();
17
envObj
->episode();
18
std::chrono::steady_clock::time_point
end
= std::chrono::steady_clock::now();
19
std::cout <<
"Simulation took "
<< std::chrono::duration_cast<std::chrono::microseconds>(
end
-
begin
).count()/1000000 <<
" s"
<< std::endl;
20
21
22
return
0;
23
}
script.envObj
envObj
Definition:
script.py:185
script.begin
begin
Definition:
script.py:184
cpp_example.h
main
int main(int argc, char **argv)
Definition:
cpp_main.cpp:5
script.output_flag
bool output_flag
Definition:
script.py:181
script.end
end
Definition:
script.py:188
Generated by
1.8.19