Skip to content

Commit 40ef0d8

Browse files
committed
Add a fixed random seed to PredPrey to avoid division by zero.
1 parent 643e571 commit 40ef0d8

File tree

3 files changed

+2
-1
lines changed

3 files changed

+2
-1
lines changed

episodes/fig/predprey_out.png

-3.92 KB
Loading

episodes/files/pred-prey/predprey.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,8 @@ def _plot(self):
403403
plt.legend()
404404
plt.savefig('predprey_out.png')
405405

406-
def run(self):
406+
def run(self, random_seed=12):
407+
np.random.seed(random_seed)
407408
# init
408409
self._init_population()
409410
self._init_log()
-66.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)