Skip to content

jonaspleyer/cr_mech_coli

Repository files navigation

The cellular_raza logo

cr_mech_coli

License: GPL 2.0 Test CI Docs PyPI - Version

Find the documentation of this package under jonaspleyer.github.io/cr_mech_coli/.

Example

import cr_mech_coli as crm

# Contains settings regarding simulation domain, time increments etc.
config = crm.Configuration()

# Use predefined values for agents
agent_settings = crm.AgentSettings()

# Automatically generate positions
positions = crm.generate_positions_old(
    4,
    agent_settings,
    config
)

# Create new agents
agents = [
    crm.RodAgent(
        pos=p,
        vel=p*0.0,
        **agent_settings.to_rod_agent_dict()
    )
    for p in positions
]

# Run simulation and return container
cell_container = crm.run_simulation_with_agents(agents, config)

# Plot individual results
crm.store_all_images(cell_container, config.domain_size)

The generated images will be stored (by default) in out.

out
├── images
│   ├── 000000100.png
│   ...
│   └── 000001000.png
├── masks
│   ├── 000000100.png
│   ...
│   └── 000001000.png