Commit 0e777f1a authored by David A.. Werner's avatar David A.. Werner
Browse files

Added example animation code usage

parent 47344a40
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)
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