Skip to content

Tube

import rgrow as rg
import matplotlib.pyplot as plt
tiles = [
        rg.Tile(edges=[1,4,6,1], color="green"),
        rg.Tile(edges=[2,5,4,2], color="teal"),
        rg.Tile(edges=[3,6,5,3], color="blue"),
        rg.Tile(edges=[4,2,1,4], color="red"),
        rg.Tile(edges=[5,3,2,5], color="orange"),
        rg.Tile(edges=[6,1,3,6], color="yellow")
]
ts = rg.TileSet(tiles)
ts.canvas_type = 'periodic'
ts.size = (6, 64)

ts.seed = [
    (0, 10, 3),
    (2, 9,  2),
    (4, 8,  1)
]

ts.block = 8
system, state = ts.create_system_and_state()
system.evolve(state, for_events=10000)
EvolveOutcome.ReachedEventsMax
ts.run_window()
State(n_tiles=4, time=1431749.0495047655 s, events=3867699, size=(64, 6), total_rate=305.1146305249364)
plt.imshow(state.canvas_view)
<matplotlib.image.AxesImage at 0x7fe97355a390>

png

plt.imshow(state.canvas_view)
<matplotlib.image.AxesImage at 0x7f2dea0d1b90>

png




EvolveOutcome.ReachedEventsMax
plt.imshow(state.canvas_copy())
<matplotlib.image.AxesImage at 0x7f1dfc035050>

png

sys.evolve?
Signature:
sys.evolve(
    state,
    for_events=Ellipsis,
    total_events=Ellipsis,
    for_time=Ellipsis,
    total_time=Ellipsis,
    size_min=Ellipsis,
    size_max=Ellipsis,
    for_wall_time=Ellipsis,
    require_strong_bound=Ellipsis,
)
Docstring: <no docstring>
Type:      builtin_function_or_method