rgrow.Simulation.canvas_view#

Simulation.canvas_view(state_index: int = 0) ndarray#

Returns the current canvas for state_index (default 0), as a direct view of the state array. This array will update as the simulation evolves. It should not be modified, as modifications will not result in rate and other necessary updates.

Using this may cause memory safety problems: it is ‘unsafe’-labelled in Rust. Unless the state is deleted, the array should remain valid so long as the underlying Simulation has not been garbage-collected.

Parameters:
state_indexint, optional

The index of the state to return. Defaults to 0.

Returns:
numpy.ndarray[int]

The current canvas for the state.