160 KiB
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 [ ]: