Skip to content

Commit

Permalink
Merge pull request #93 from devosoft/fix-set-random-seed
Browse files Browse the repository at this point in the history
Fix set random seed
  • Loading branch information
mmore500 authored Sep 16, 2024
2 parents af14797 + fc04fc2 commit 3912c57
Show file tree
Hide file tree
Showing 15 changed files with 222 additions and 218 deletions.
8 changes: 6 additions & 2 deletions avida-core/source/actions/DriverActions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ class cActionExitDemeResources : public cAction {

class cActionSetRandomSeed : public cAction {
public:
/*! Constructor; parse out the number of replications.
/*! Constructor; parse out the seed.
*/
cActionSetRandomSeed(cWorld* world, const cString& args, Feedback&) : cAction(world, args) {
cString largs(args);
Expand All @@ -273,7 +273,11 @@ class cActionSetRandomSeed : public cAction {

// When resetting the random seed, the timeslicer also needs to be rebuilt, since it may use the RNG
// Resizing the cell grid triggers the reconstruction of the timeslicer, so...
m_world->GetPopulation().ResizeCellGrid(m_world->GetConfig().WORLD_X.Get(), m_world->GetConfig().WORLD_Y.Get());
// @MAM 2024-09 - Removed this line when copying code from
// Avida::Viewer::Driver::SetRandomSeed
// because it was causing populations in Bhaskar's experiments to freeze.
// I'm not sure why it was here in the first place....
// m_world->GetPopulation().ResizeCellGrid(m_world->GetConfig().WORLD_X.Get(), m_world->GetConfig().WORLD_Y.Get());
}

protected:
Expand Down
100 changes: 50 additions & 50 deletions avida-core/tests/set_random_seed/expected/data/parasites1.grid

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Avida Dominant Parasite Data
# Mon Sep 16 14:34:19 2024
# Mon Sep 16 18:51:06 2024
# 1: Update
# 2: Number of Extant Parasites

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Avida Dominant Parasite Data
# Mon Sep 16 14:34:27 2024
# Mon Sep 16 18:51:14 2024
# 1: Update
# 2: Number of Extant Parasites

1000 867
1000 835
100 changes: 50 additions & 50 deletions avida-core/tests/set_random_seed/expected/data/parasites2.grid

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Avida Dominant Parasite Data
# Mon Sep 16 14:34:30 2024
# Mon Sep 16 18:51:17 2024
# 1: Update
# 2: Number of Extant Parasites

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Avida Dominant Parasite Data
# Mon Sep 16 14:34:37 2024
# Mon Sep 16 18:51:26 2024
# 1: Update
# 2: Number of Extant Parasites

2000 924
2000 917
4 changes: 2 additions & 2 deletions avida-core/tests/set_random_seed/expected/data/parasites3.dat
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Avida Dominant Parasite Data
# Mon Sep 16 14:34:37 2024
# Mon Sep 16 18:51:26 2024
# 1: Update
# 2: Number of Extant Parasites

2001 924
2001 909
100 changes: 50 additions & 50 deletions avida-core/tests/set_random_seed2/expected/data/parasites1.grid

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Avida Dominant Parasite Data
# Mon Sep 16 14:52:23 2024
# Mon Sep 16 18:51:28 2024
# 1: Update
# 2: Number of Extant Parasites

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Avida Dominant Parasite Data
# Mon Sep 16 14:52:34 2024
# Mon Sep 16 18:51:36 2024
# 1: Update
# 2: Number of Extant Parasites

1000 867
1000 835
100 changes: 50 additions & 50 deletions avida-core/tests/set_random_seed2/expected/data/parasites2.grid

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Avida Dominant Parasite Data
# Mon Sep 16 14:52:37 2024
# Mon Sep 16 18:51:39 2024
# 1: Update
# 2: Number of Extant Parasites

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Avida Dominant Parasite Data
# Mon Sep 16 14:52:46 2024
# Mon Sep 16 18:51:47 2024
# 1: Update
# 2: Number of Extant Parasites

2000 950
2000 724
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Avida Dominant Parasite Data
# Mon Sep 16 14:52:46 2024
# Mon Sep 16 18:51:47 2024
# 1: Update
# 2: Number of Extant Parasites

2001 950
2001 714

0 comments on commit 3912c57

Please sign in to comment.