zasim.zacformat - text_to_cell Interop

Text to Cell is a piece of Software developed by Tobias Maier. It takes a high-level description of a cellular automaton as input and outputs different formats. One of them is made for interoperability with zasim. It can be loaded and simulated with a ZacSimulator and its data can be displayed with a ZacConsoleDisplay.

Inheritance diagram of zasim.zacformat

This module implements whatever’s necessary to work with .zac files like text_to_cell outputs.

zasim.zacformat.n2c(name)

Turn a name of a subcell into x/y coords

zasim.zacformat.c2n(x, y)
zasim.zacformat.draw_box_template(boxes, t_w=1, w=None, h=None)[source]

Create an ascii art template suitable for string interpolation.

If you want correct outer borders, you need to wrap box positions for y=-1, y=h+1, x=-1 and x=w+1.

Parameters:
  • boxes – a list of x, y tuples that show which fields are filled.
  • w – the width of each of the boxes.
Returns:

a list of strings usable for drawing an ascii box art.

zasim.zacformat.draw_tiled_box_template(boxes, w=1, twodim=True)[source]

This makes template chunks for either four corners, four sides and a center for a lattice of box-templates or - if twodim is False - for the left and right end and the body of a line of box-templates.

class zasim.zacformat.ZacConsoleDisplay(simulator, connect=True, auto_output=True)[source]

Bases: object

connect_simulator()[source]
after_step(update_step=True)[source]
conf_changed()[source]
conf_replaced()[source]
measure_sets()[source]
draw_conf(update_step=True)[source]
class zasim.zacformat.ZacNeighbourhood(neigh_data, subcells)[source]

Bases: zasim.cagen.neighbourhoods.SimpleNeighbourhood

visit()[source]

Adds C and python code to get the neighbouring values and stores them in local variables.

class zasim.zacformat.ZacSimulator(data_or_file, shape)[source]

Bases: zasim.simulator.SimulatorInterface

staticMetaObject = <PySide.QtCore.QMetaObject object at 0x4b897a0>
get_config()[source]
step()[source]

Previous topic

zasim.elementarytools - Tools for manipulating Elementary Step Functions

This Page