mirror of
https://github.com/JHUAPL/kami.git
synced 2026-01-09 14:58:02 -05:00
Updates to the Starter example reflecting Model changes
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user