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

160 KiB

In [2]:
%matplotlib inline

from walker import Walker
from plotting import plot_trajectory, plot_trajectory_hexbin

Simulate a trajectory

In [3]:
# Create a Walker instance
walker = Walker(sigma_i=3, sigma_j=4, size=200, map_type='hills')

# Sample a next step 1000 times
i, j = 100, 50
trajectory = []
for _ in range(1000):
    i, j = walker.sample_next_step(i, j)
    trajectory.append((i, j))
In [5]:
plot_trajectory(trajectory, walker.context_map)
In [6]:
plot_trajectory_hexbin(trajectory)
In [ ]: