This commit is contained in:
James P. Howard, II
2021-07-20 12:15:33 -04:00
parent 2735cef23e
commit 382e074b7e
2 changed files with 4 additions and 17 deletions

View File

@@ -112,16 +112,10 @@ void MoneyAgent1D::give_money() {
}
BoltzmannWealthModel1D::BoltzmannWealthModel1D(unsigned int number_agents,
unsigned int length_x,
unsigned int new_seed) {
rng = make_shared<mt19937>();
rng->seed(new_seed);
unsigned int length_x) {
_world = new MultiGrid1D(length_x, true);
_sched = new RandomScheduler(this, rng);
console->debug("Scheduler initiated with seed {}", new_seed);
_step_count = 0;
MoneyAgent1D::set_world(_world);
MoneyAgent1D::set_model(this);
@@ -191,7 +185,8 @@ int main(int argc, char **argv) {
"{} steps",
agent_count, x_size, max_steps);
BoltzmannWealthModel1D model(agent_count, x_size, initial_seed);
rng = make_shared<mt19937>(initial_seed);
BoltzmannWealthModel1D model(agent_count, x_size);
spdlog::stopwatch sw;
for (int i = 0; i < max_steps; i++) {

View File

@@ -102,12 +102,9 @@ class BoltzmannWealthModel1D : public Model {
* @param[in] number_agents the number of agents to assign to the model.
* @param[in] length_x the length of the one-dimensional world the agents
* occupy.
* @param[in] new_seed the initial seed used for the random number
* generator.
*/
BoltzmannWealthModel1D(unsigned int number_agents = 10,
unsigned int length_x = 10,
unsigned int new_seed = 42);
unsigned int length_x = 10);
/**
* Destroy the instance
@@ -126,11 +123,6 @@ class BoltzmannWealthModel1D : public Model {
*/
void run(unsigned int n);
/**
* Return the seed used to initialize the model.
*/
int get_seed() const;
/**
* Get the MoneyAgent instance associated with the given `AgentID`
*