Created
September 25, 2017 21:09
-
-
Save rmorey/8369eb47009ccc925b4c0f5c3e28018c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
from assignment1 import * | |
NUM_TRIALS = 100 | |
SIZE = 5 | |
NUM_ITERATIONS = 1000 | |
FILENAME = "hill_climb_{}_{}x{}.gz".format(SIZE,NUM_TRIALS,NUM_ITERATIONS) | |
data = [] | |
for i in range(NUM_TRIALS): | |
_, vals = hill_climb(generate_puzzle(SIZE),NUM_ITERATIONS) | |
data.append(vals) | |
data = np.array(data) | |
np.savetxt(FILENAME,data) | |
plt.plot([np.mean(r) for r in data.T]) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment