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
73534ae1
Commit
73534ae1
authored
May 07, 2018
by
David A.. Werner
Browse files
Use all available threads
parent
f47a387a
Changes
1
Hide whitespace changes
Inline
Side-by-side
simulation_with_pool.py
View file @
73534ae1
...
...
@@ -10,7 +10,7 @@ def random_manduca():
return
SimpleManduca
.
random_individual
(
num_legs
,
time_segments
,
time_step
)
try
:
pool
=
multiprocessing
.
Pool
(
int
(
0.9
*
multiprocessing
.
cpu_count
()))
pool
=
multiprocessing
.
Pool
(
int
(
multiprocessing
.
cpu_count
()))
simulator
=
EvolutionSimulator
((
random_manduca
,
POPULATION_SIZE
),
pool
=
pool
)
simulator
.
run_simulation
(
NUM_GENERATIONS
)
finally
:
...
...
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