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
Commits
825f37dc
Commit
825f37dc
authored
May 02, 2018
by
David A.. Werner
Browse files
More verbose progress bar
parent
a08dc059
Changes
1
Hide whitespace changes
Inline
Side-by-side
manduca/Population.py
View file @
825f37dc
...
...
@@ -153,7 +153,8 @@ class EvolutionSimulator(object):
return
num_after_survival
def
run_simulation
(
self
,
num_generations
,
history_interval
=
1
,
progress_bar
=
True
):
for
generation
in
tqdm
.
tqdm
(
range
(
num_generations
),
disable
=
not
(
progress_bar
)):
progress_kwargs
=
{
'disable'
:
not
(
progress_bar
),
'desc'
:
'Genetic Algorithm Simulation'
,
'unit'
:
'gen'
}
for
generation
in
tqdm
.
tqdm
(
range
(
num_generations
),
**
progress_kwargs
):
generation_info
=
self
.
next_generation
(
generation
)
if
generation
%
history_interval
==
0
or
generation
==
0
or
generation
==
num_generations
-
1
:
self
.
history
.
append
(
generation_info
)
...
...
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