Skip to content

IEnvironment is not stepable

Dear all,

IEnvironment does currently not mandate a Step() function cf. environmentInterface.h. Is there a reason it should not be stepable?

Consider the following usage example:

std::shared_ptr<IEnvironment> m_environment;
std::shared_ptr<IScenarioEngine> m_scenario_engine;

SimulatorImpl::SimulatorImpl()
{
  m_environment = std::make_shared<EnvironmentImpl>();
  m_scenario_engine = std::make_shared<ScenarioEngineImpl>(m_environment);
  ...
}

void SimulatorImpl::Step()
{
  m_environment->Step();
  m_scenario_engine->Step();
  ...
}

If we agreed on making IEnvironment stepable, we could derive from IStepable e.g.:

struct IStepable
{
  virtual ~IStepable() = default;

  virtual bool PreStep() = 0;
  virtual bool Step() = 0;
  virtual bool PostStep() = 0;
};

The need for PreStep() and PostStep() would need to be discussed as well.

Cheers, Martin

Martin Stump martin.stump@mercedes-benz.com on behalf of Mercedes-Benz Tech Innovation GmbH, Provider Information

Edited by Martin Stump