MySources/simulationmodelfactory.cpp

19 lines
655 B
C++

#include "simulationmodelfactory.hpp"
SimulationModelFactory::SimulationModelFactory() {}
std::unique_ptr<SimulationModel> SimulationModelFactory::create(
const std::string &simulationModelLabel)
{
if (simulationModelLabel == DRMSimulationModel::label) {
return std::make_unique<DRMSimulationModel>();
} else if (simulationModelLabel == ChronosEulerSimulationModel::label) {
return std::make_unique<ChronosEulerSimulationModel>();
}
std::cerr << "Simulation model used for computing the optimization results was "
"not recognized"
<< std::endl;
assert(false);
return nullptr;
}