rgrow.Simulation#

class rgrow.Simulation(tileset: TileSet, system: System | None = None, states: List[State] | None = None)#
__init__(tileset: TileSet, system: System | None = None, states: List[State] | None = None)#

Methods

__init__(tileset[, system, states])

add_n_states(n)

Add n states to the simulation.

add_state()

Add a state to the simulation.

canvas_copy([state_index])

Returns a copy of the current canvas for state_index (default 0).

canvas_view([state_index])

Returns the current canvas for state_index (default 0), as a direct view of the state array.

check_state([n])

Check that the simulation has at least n states.

ensure_state([n])

Ensure that the simulation has at least n states.

evolve([state_index, for_events, ...])

Evolve a particular state, with index state_index, subject to some bounds.

evolve_all([for_events, total_events, ...])

Evolve all states, stopping each as they reach the boundary conditions.

evolve_some(state_indices[, for_events, ...])

Evolve some states, stopping each as they reach the boundary conditions.

get_system_param(name)

Gets a system parameter.

mismatch_array([state_index])

Returns an array of mismatches in the state.

n_mismatches([state_index])

Returns the number of mismatches in the state.

name_canvas([state_index])

Returns the current canvas for state_index (default 0), as an array of tile names.

plot_state([state_index, ax])

Plot a state as a pcolormesh.

set_system_param(name, value)

Sets a system parameter to a value.

state_events([state_index])

Returns the number of events simulated for a state.

state_ntiles([state_index])

Returns the number of tiles in the state.

state_time([state_index])

Returns the amount of time simulated (in seconds) for the state.

tile_cmap()

Returns a matplotlib colormap for tile numbers.

Attributes

states_events

Returns the number of events simulated for each state.

states_ntiles

Returns the number of tiles in each state.

states_time

Returns the amount of time simulated (in seconds) for each state.

tile_colors

Returns the colors of each tile in the system.

tile_concs

Returns the concentration of each tile in the system.

tile_names

Returns the names of each tile in the system.

tile_stoics

Returns the stoichiometry of each tile in the system.

tileset

system

states