Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Alexander R. Hankin
EE194_Manduca_Simulator_Demo
Commits
6bb2adb1
Commit
6bb2adb1
authored
May 08, 2018
by
David A.. Werner
Browse files
Complex Manduca used 7 legs when it was meant to use 5
parent
0e777f1a
Changes
1
Hide whitespace changes
Inline
Side-by-side
assignment_sim.py
View file @
6bb2adb1
...
...
@@ -30,6 +30,14 @@ try:
histories
.
append
(
simulator
.
history
)
simulator
.
update_fitness
()
simulator
.
population
[
0
].
save
(
'fittest_manduca_{}.npz'
.
format
(
idx
))
# Run a simulation with Manduca rather than SimpleManduca
simulator
=
EvolutionSimulator
(
random_manduca
,
pool
=
pool
,
evolution_parameters
=
evolution_parameters
,
random_number_generator
=
rng
,
random_seed
=
0xBAD
)
simulator
.
run_simulation
(
NUM_GENERATIONS
)
simulator
.
update_fitness
()
simulator
.
population
[
0
].
save
(
'fittest_manduca_complex.npz'
)
# Run a simulation with other number of legs
for
num_legs
in
[
2
,
3
,
7
]:
simulator
=
EvolutionSimulator
(
random_simple_manduca
,
pool
=
pool
,
...
...
@@ -38,13 +46,6 @@ try:
simulator
.
run_simulation
(
NUM_GENERATIONS
)
simulator
.
update_fitness
()
simulator
.
population
[
0
].
save
(
'fittest_manduca_legs_{}.npz'
.
format
(
num_legs
))
simulator
=
EvolutionSimulator
(
random_manduca
,
pool
=
pool
,
evolution_parameters
=
evolution_parameters
,
random_number_generator
=
rng
,
random_seed
=
0xBAD
)
simulator
.
run_simulation
(
NUM_GENERATIONS
)
simulator
.
update_fitness
()
simulator
.
population
[
0
].
save
(
'fittest_manduca_complex.npz'
)
finally
:
pool
.
close
()
pool
.
join
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment