antfarm.base#

Module contents#

class antfarm.base.AntFarm(n_ants=500, size=4.0, style='white', inset=0.1, scale=6.0, wrap=True, **kwargs)#

Bases: RunTime

plot(return_plot=False)#
record(n_steps=500, fps=30.0, path=None, show=False, verbose=True, **kwargs)#
class antfarm.base.Canvas(*args: t.Any, **kwargs: t.Any)#

Bases: MultiCanvas

set_color(color=None)#
show(background='transparent')#
class antfarm.base.RunTime(spf=0.02, dt=2.0, seed=None, **kwargs)#

Bases: object

copy(state=None)#
reset(*_)#
start()#
stop()#
toggle(*_)#
class antfarm.base.VideoWriter(width=500, height=500, fps=30.0, path='_autoplay.mp4')#

Bases: object

Utility for writing RGB image arrays to a video stream.

save()#

Converts the current frame sequence into a video stream.

show()#
write(img)#

Adds the given RGB image array to the frame sequence.