2024-heraklion-scientific-p.../notebooks/walker/Step_5_reproducibility/solution/Step_5_reproducibility.ipynb
2024-08-27 15:52:41 +03:00

61 KiB

In [4]:
%matplotlib inline

import matplotlib.pyplot as plt
import numpy as np

from plotting import plot_trajectory
from walker import Walker

For this Exercise let's go back to the version of the walker with only one "next step proposal".

1. Complete the run.py script

  • In the file, at the top we give the desired parameters for the run
  • create a context map and walker (see previous exercises for reference)
  • simulate a trajectory (see previous exercises for reference)
  • save the trajectory using np.save() and some metadata

2. Run the run.py script twice and compare that the outcome is identical by plotting the result below

In [5]:
trajectory = np.load("sim_20230628-192022.npy") # change the name of the file here!
In [6]:
plt.plot(trajectory[:,0], trajectory[:,1])
Out[6]:
[<matplotlib.lines.Line2D at 0x12c7436d0>]
In [ ]: