Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complete run.py #13

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions notebooks/walker/Step_5_reproducibility/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,21 @@
random_state = np.random.RandomState(seed)

# STEP 1: Create a context map

context_map=context_maps.labyrinth_context_map_builder(size)

# STEP 2: Create a Walker

walker = Walker(sigma_i, sigma_j, context_map)

# STEP 3: Simulate the walk

trajectory = []
for _ in range(1000):
i, j = walker.sample_next_step(i, j)
trajectory.append((i, j))

# STEP 4: Save the trajectory
curr_time = time.strftime("%Y%m%d-%H%M%S")
# save the npy file here!
np.save(f"sim_{curr_time}.npy", np.array(trajectory))

# STEP 5: Save the metadata
# lookup git repository
Expand Down