vivarium.library.pymunk_multibody module

class vivarium.library.pymunk_multibody.NullScreen[source]

Bases: object

configure(config)[source]
update_screen()[source]
class vivarium.library.pymunk_multibody.PymunkMultibody(config)[source]

Bases: object

Multibody object for interfacing with pymunk

add_barriers(bounds, barriers)[source]

Create static barriers

add_body_from_center(body_id, specs)[source]
apply_jitter_force(body)[source]
apply_motile_force(body)[source]
apply_viscous_force(body)[source]
defaults = {'agent_shape': 'segment', 'angular_damping': 0.8, 'barriers': False, 'bounds': [20, 20], 'damping': 0.5, 'elasticity': 0.9, 'force_scaling': 100.0, 'friction': 0.9, 'initial_agents': {}, 'jitter_force': 0.001, 'physics_dt': 0.001, 'screen': None}
get_body_position(agent_id)[source]
get_body_positions()[source]
get_inertia(shape, mass)[source]
get_shape(boundary)[source]

shape documentation at: https://pymunk-tutorial.readthedocs.io/en/latest/shape/shape.html

run(timestep)[source]
update_bodies(bodies)[source]
update_body(body_id, specs)[source]
vivarium.library.pymunk_multibody.corner_from_center(width, length, center_position, angle)[source]
vivarium.library.pymunk_multibody.front_from_corner(width, length, corner_position, angle)[source]
vivarium.library.pymunk_multibody.get_force_with_angle(force, angle)[source]
vivarium.library.pymunk_multibody.random_body_position(body)[source]

pick a random point along the boundary

vivarium.library.pymunk_multibody.test_multibody(total_time=2, agent_shape='rectangle', n_agents=1, jitter_force=10.0, screen=None)[source]