Commit 215b1653 authored by David A.. Werner's avatar David A.. Werner
Browse files

Added example of reproducable simulation

parent 00712002
""" This is a script that generates the basic functionality of the
EE194_Manduca_Simulator package with reproducable results """
import numpy as np
from manduca import SimpleManduca, Population, EvolutionSimulator
POPULATION_SIZE, NUM_GENERATIONS= 10, 25
num_legs, time_segments, time_step = 2, 4, 10
def random_manduca():
return SimpleManduca.random_individual(num_legs, time_segments, time_step, rng=rng)
RND_SEED = 0xDEADBEEF
rng = np.random.RandomState()
rng.seed(RND_SEED)
simulator = EvolutionSimulator((random_manduca, POPULATION_SIZE), random_number_generator=rng,
random_seed=0xDEADBEEF)
simulator.run_simulation(NUM_GENERATIONS)
print simulator.history[-1]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment