mirror of
https://github.com/JHUAPL/kami.git
synced 2026-01-09 14:58:02 -05:00
You know, there is no reason Model has to define the step/run interface
The user can do that for themselves
This commit is contained in:
@@ -163,12 +163,6 @@ BoltzmannWealthModel1D::BoltzmannWealthModel1D(unsigned int number_agents, unsig
|
||||
}
|
||||
}
|
||||
|
||||
std::shared_ptr<kami::Model> BoltzmannWealthModel1D::run(unsigned int steps) {
|
||||
for (auto i = 0; i < steps; i++)
|
||||
step();
|
||||
return shared_from_this();
|
||||
}
|
||||
|
||||
std::shared_ptr<kami::Model> BoltzmannWealthModel1D::step() {
|
||||
console->trace("Executing model step {}", ++_step_count);
|
||||
_sched->step(shared_from_this());
|
||||
|
||||
@@ -96,14 +96,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();
|
||||
|
||||
private:
|
||||
unsigned int _step_count;
|
||||
|
||||
@@ -164,12 +164,6 @@ BoltzmannWealthModel2D::BoltzmannWealthModel2D(unsigned int number_agents, unsig
|
||||
}
|
||||
}
|
||||
|
||||
std::shared_ptr<kami::Model> BoltzmannWealthModel2D::run(unsigned int steps) {
|
||||
for (auto i = 0; i < steps; i++)
|
||||
step();
|
||||
return shared_from_this();
|
||||
}
|
||||
|
||||
std::shared_ptr<kami::Model> BoltzmannWealthModel2D::step() {
|
||||
console->trace("Executing model step {}", _step_count++);
|
||||
_sched->step(shared_from_this());
|
||||
|
||||
@@ -99,14 +99,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();
|
||||
|
||||
private:
|
||||
unsigned int _step_count;
|
||||
|
||||
Reference in New Issue
Block a user