Skip to content

Commit 3912c57

Browse files
authored
Merge pull request #93 from devosoft/fix-set-random-seed
Fix set random seed
2 parents af14797 + fc04fc2 commit 3912c57

File tree

15 files changed

+222
-218
lines changed

15 files changed

+222
-218
lines changed

avida-core/source/actions/DriverActions.cc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ class cActionExitDemeResources : public cAction {
252252

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

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

279283
protected:

avida-core/tests/set_random_seed/expected/data/parasites1.grid

Lines changed: 50 additions & 50 deletions
Large diffs are not rendered by default.

avida-core/tests/set_random_seed/expected/data/parasites1a.dat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Avida Dominant Parasite Data
2-
# Mon Sep 16 14:34:19 2024
2+
# Mon Sep 16 18:51:06 2024
33
# 1: Update
44
# 2: Number of Extant Parasites
55

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Avida Dominant Parasite Data
2-
# Mon Sep 16 14:34:27 2024
2+
# Mon Sep 16 18:51:14 2024
33
# 1: Update
44
# 2: Number of Extant Parasites
55

6-
1000 867
6+
1000 835

avida-core/tests/set_random_seed/expected/data/parasites2.grid

Lines changed: 50 additions & 50 deletions
Large diffs are not rendered by default.

avida-core/tests/set_random_seed/expected/data/parasites2a.dat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Avida Dominant Parasite Data
2-
# Mon Sep 16 14:34:30 2024
2+
# Mon Sep 16 18:51:17 2024
33
# 1: Update
44
# 2: Number of Extant Parasites
55

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Avida Dominant Parasite Data
2-
# Mon Sep 16 14:34:37 2024
2+
# Mon Sep 16 18:51:26 2024
33
# 1: Update
44
# 2: Number of Extant Parasites
55

6-
2000 924
6+
2000 917
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Avida Dominant Parasite Data
2-
# Mon Sep 16 14:34:37 2024
2+
# Mon Sep 16 18:51:26 2024
33
# 1: Update
44
# 2: Number of Extant Parasites
55

6-
2001 924
6+
2001 909

avida-core/tests/set_random_seed2/expected/data/parasites1.grid

Lines changed: 50 additions & 50 deletions
Large diffs are not rendered by default.

avida-core/tests/set_random_seed2/expected/data/parasites1a.dat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Avida Dominant Parasite Data
2-
# Mon Sep 16 14:52:23 2024
2+
# Mon Sep 16 18:51:28 2024
33
# 1: Update
44
# 2: Number of Extant Parasites
55

0 commit comments

Comments
 (0)