Updates to the Starter example reflecting Model changes

This commit is contained in:
James P. Howard, II
2022-08-19 20:27:50 -04:00
parent 9333e1c2fa
commit e7a5f342bf
2 changed files with 2 additions and 14 deletions

View File

@@ -79,7 +79,7 @@ StarterModel::StarterModel(unsigned int number_agents, unsigned int new_seed) {
_step_count = 0;
for (unsigned int i = 0; i < number_agents; i++) {
for (auto i = 0; i < number_agents; i++) {
auto new_agent = std::make_shared<StarterAgent>();
console->trace("Initializing agent with AgentID {}", new_agent->get_agent_id());
@@ -87,11 +87,6 @@ StarterModel::StarterModel(unsigned int number_agents, unsigned int new_seed) {
}
}
std::shared_ptr<kami::Model> StarterModel::run(unsigned int steps) {
for (auto i = 0; i < steps; i++) step();
return shared_from_this();
}
std::shared_ptr<kami::Model> StarterModel::step() {
console->trace("Executing model step {}", ++_step_count);
_sched->step(shared_from_this());

View File

@@ -82,14 +82,7 @@ public:
/**
* Execute a single time-step for the model.
*/
std::shared_ptr<kami::Model> step() override;
/**
* Execute a number of time-steps for the model.
*
* @param[in] n the number of steps to execute.
*/
std::shared_ptr<kami::Model> run(unsigned int n) override;
std::shared_ptr<kami::Model> step();
};
#endif // STARTER_H