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
0e777f1a
Commit
0e777f1a
authored
May 08, 2018
by
David A.. Werner
Browse files
Added example animation code usage
parent
47344a40
Changes
1
Hide whitespace changes
Inline
Side-by-side
assignment_anim.py
0 → 100644
View file @
0e777f1a
import
glob
from
manduca
import
SimpleManduca
,
Manduca
from
manduca.Visualization
import
animate
,
animate_as_gif
,
animate_as_mp4
manducas
=
[]
for
m_file
in
glob
.
glob
(
'fittest_manduca_*.npz'
):
if
"complex"
in
m_file
:
manduca
=
Manduca
.
load
(
m_file
)
else
:
manduca
=
SimpleManduca
.
load
(
m_file
)
manducas
.
append
((
manduca
,
m_file
.
replace
(
".npz"
,
""
).
replace
(
"fittest_manduca_"
,
""
)))
animate
(
manducas
[
0
])
animate_as_gif
(
'one_manduca.gif'
,
manducas
[
0
])
animate_as_mp4
(
'one_manduca.mp4'
,
manducas
[
0
])
multi_kwargs
=
{
'dpi'
:
200
,
'show_winners'
:
True
,
'show_fitnesses'
:
True
,
'subplot_kwargs'
:{
'figsize'
:
(
16
,
9
)}}
animate
(
*
manducas
,
**
multi_kwargs
)
animate_as_gif
(
'all_manducas.gif'
,
*
manducas
,
**
multi_kwargs
)
animate_as_mp4
(
'all_manducas.mp4'
,
*
manducas
,
**
multi_kwargs
)
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