ecoli.library.pymunk_multibody

class ecoli.library.pymunk_multibody.NullScreen[source]

Bases: object

configure(config)[source]
update_screen()[source]
class ecoli.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': 50000.0, 'friction': 0.9, 'initial_agents': {}, 'jitter_force': 0.001, 'physics_dt': 0.001, 'screen': None, 'seed': 0}
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]
ecoli.library.pymunk_multibody.corner_from_center(width, length, center_position, angle)[source]
ecoli.library.pymunk_multibody.front_from_corner(width, length, corner_position, angle)[source]
ecoli.library.pymunk_multibody.get_force_with_angle(force, angle)[source]
ecoli.library.pymunk_multibody.random_body_position(body, rng)[source]

pick a random point along the boundary