vivarium.processes.cellular_potts module

class vivarium.processes.cellular_potts.CPM(config)[source]

Bases: object

boltzmann_acceptance_function(energy)[source]
effective_energy(grid)[source]
get_agent_area(agent_id, grid)[source]
get_agents_areas(grid)[source]
get_interactions(site, grid)[source]
inverse_kronecker_delta(value1, value2)[source]

Returns 0 if the values are the same, and 1 if they are different. Keeps neighboring sites with the same value from contributing to the effective energy

mutate(grid)[source]

choose a random site and a random neighboring site. If they have the same values, change the site to its neighbor’s value. If a successful mutation is made, return True

neighbor_sites(site)[source]

return the (x, y) of all neighboring sites

neighbor_values(site, grid)[source]
random_neighbor(site)[source]

return a random neighbor, without wrapping

random_site()[source]
update()[source]

Metropolis Monte Carlo. Attempt as many updates as there are sites in the grid

update_adhesion_matrix()[source]
update_target_areas(areas)[source]
class vivarium.processes.cellular_potts.CellularPotts(initial_parameters=None)[source]

Bases: vivarium.core.process.Process

Cellular Potts model

To run with animation on set animate: True, and use the TKAgg matplotlib backend: > MPLBACKEND=TKAgg python vivarium/processes/cellular_potts.py

animate_frame()[source]
defaults = {'grid_size': (10, 10), 'n_agents': 1, 'target_area': 10}
name = 'cellular_potts'
next_update(timestep, states)[source]
ports_schema()[source]
vivarium.processes.cellular_potts.get_cpm_config()[source]
vivarium.processes.cellular_potts.get_cpm_minimum_config()[source]
vivarium.processes.cellular_potts.run_CPM(cpm_config={'animate': True, 'grid_size': (20, 20), 'n_agents': 2, 'target_area': 10}, time=5)[source]