25 lines
957 B
C++
Executable File
25 lines
957 B
C++
Executable File
#include "generators/terminator_generator.h"
|
|
|
|
#include "generators/geometry_generator.h"
|
|
|
|
namespace generator {
|
|
|
|
std::shared_ptr<Terminator> buildTerminator(
|
|
Parameter& parameter,
|
|
const json_path& path_to_terminator) {
|
|
DEBUG_LEVEL_2("Creating terminator.");
|
|
long int max_interactions = static_cast<long int>(parameter.doubleValue(
|
|
json_path_append(path_to_terminator, {"MaximumInteractions"})));
|
|
double max_time_alive = parameter.doubleValue(
|
|
json_path_append(path_to_terminator, {"MaxTimeAlive", "value"}));
|
|
DEBUG_LEVEL_3("with max interactions: " + std::to_string(max_interactions));
|
|
DEBUG_LEVEL_3("with max time alive: " + std::to_string(max_time_alive));
|
|
|
|
std::shared_ptr<Geometry> geometry = buildGeometry(
|
|
parameter, json_path_append(path_to_terminator, {"BoundaryGeometry"}));
|
|
|
|
return std::shared_ptr<Terminator>(
|
|
new Terminator(max_interactions, max_time_alive, geometry));
|
|
}
|
|
|
|
}; // namespace generator
|