Simulation#

Running simulations#

Simulation(tileset[, system, states])

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

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

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

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

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

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

Modifying simulations and getting information#

Simulation.add_state()

Add a state to the simulation.

Simulation.add_n_states(n)

Add n states to the simulation.

Simulation.set_system_param(name, value)

Sets a system parameter to a value.

Simulation.get_system_param(name)

Gets a system parameter.

Simulation.canvas_copy([state_index])

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

Simulation.canvas_view([state_index])

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

Simulation.state_events([state_index])

Returns the number of events simulated for a state.

Simulation.state_time([state_index])

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

Simulation.state_ntiles([state_index])

Returns the number of tiles in the state.

Simulation.states_events

Returns the number of events simulated for each state.

Simulation.states_time

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

Simulation.states_ntiles

Returns the number of tiles in each state.

Simulation.tile_concs

Returns the concentration of each tile in the system.

Simulation.tile_stoics

Returns the stoichiometry of each tile in the system.

Simulation.tile_names

Returns the names of each tile in the system.

Simulation.tile_colors

Returns the colors of each tile in the system.

Simulation.n_mismatches([state_index])

Returns the number of mismatches in the state.

Simulation.mismatch_array([state_index])

Returns an array of mismatches in the state.

Simulation.plot_state([state_index, ax])

Plot a state as a pcolormesh.

Simulation.tile_cmap()

Returns a matplotlib colormap for tile numbers.