zasim.cagen.simulators - Simulators immediately ready to be used

Inheritance diagram of zasim.cagen.simulators

zasim.cagen.simulators.automatic_stepfunc(size=None, config=None, computation=None, nondet=1, beta=1, histogram=False, activity=False, copy_borders=True, neighbourhood=None, base=2, visitors=None, sparse_loop=False, target_class=<class 'zasim.cagen.target.Target'>, needs_random_generator=False, random_generator=None, **kwargs)[source]

From the given parameters, assemble a StepFunc with the given computation and visitors objects. Additionally, a target is created.

Returns the stepfunc.

class zasim.cagen.simulators.ElementarySimulator(size=None, nondet=1, histogram=False, activity=False, rule=None, config=None, beta=1, copy_borders=True, neighbourhood=None, base=2, sparse_loop=False, **kwargs)[source]

Bases: zasim.simulator.ElementaryCagenSimulator

A ElementaryCagenSimulator with a target and stepfunc created automatically for the given parameters.

Set neighbourhood to None and a ElementaryFlatNeighbourhood will be used if the config is one-dimensional, otherwise a VonNeumannNeighbourhood will be created. If the rule number is out of range for it, a MooreNeighbourhood will be used instead.

Note

If you supply a neighbourhood, that is not based on BetaAsynchronousNeighbourhood, but set beta to a value other than 1, you will get a warning.

Parameters:
  • size – The size of the config to generate if no config is supplied. Must be a tuple.
  • nondet – If this is not 1, use this value as the probability for each cell to get executed.
  • histogram – Generate and update a histogram as well?
  • rule – The rule number for the elementary cellular automaton.
  • config – Optionally the configuration to use. Supply a configuration generator here to make the reset method of the simulator work.
  • beta – If the probability is not 1, use this as the probability for each cell to succeed in exposing its result to the neighbouring cells. This is incompatible with the nondet parameter.
  • copy_borders – Copy over data from the other side?
  • neighbourhood – The neighbourhood to use.
  • base – The base of possible values for the configuration.
  • sparse_loop – Should a sparse loop be used?
rule = None

The lookup array corresponding to the rule number.

pretty_print()[source]
staticMetaObject = <PySide.QtCore.QMetaObject object at 0x3174f38>
zasim.cagen.simulators.BinRule

alias of ElementarySimulator

class zasim.cagen.simulators.GameOfLife(size=None, nondet=1, histogram=False, activity=False, config=None, beta=1, copy_borders=True, life_params={}, sparse_loop=False, **kwargs)[source]

Bases: zasim.simulator.CagenSimulator

A CagenSimulator with a target and stepfunc created automatically for the given parameters. The supplied life_params are passed as keyword arguments to LifeCellularAutomatonBase.

Parameters:
  • size – The size of the config to generate if no config is supplied via the config parameter.
  • nondet – If this is not 1, use this value as the probability for each cell to get executed.
  • histogram – Generate and update a histogram as well?
  • config – Optionally the configuration to use. Supply a configuration generator here to make the reset method of the simulator work.
  • beta – If the probability is not 1, use this as the probability for each cell to succeed in exposing its result to the neighbouring cells. This is incompatible with the nondet parameter.
  • copy_borders – Copy over data from the other side?
  • life_params – Those parameters are passed on to the constructor of LifeCellularAutomatonBase.
  • sparse_loop – Should a sparse loop be generated?
staticMetaObject = <PySide.QtCore.QMetaObject object at 0x317a290>

Previous topic

zasim.cagen.main - Running cagen as a program

Next topic

zasim.cagen.utils - Utility functions

This Page