Migration guide (to 0.1)

Version 0.1 reshapes the internals for automatic differentiation and future neural-CA support. This page lists what changed and how to update calling code.

Field access replaced with accessor functions

Struct fields are no longer public API; use the accessor functions instead.

BeforeNow
automaton.evolutionevolution_history(automaton)
automaton.rulecellular_automaton_rule(automaton)
automaton.generationsgeneration_count(automaton)
dca.rulesetrule_lookup_table(dca)
dca.radiusneighborhood_radius(dca)
dca.statescell_state_count(dca)

Discrete rule states must have an Integer eltype

DCA/TCA now validate the state array and reject non-integer eltypes, even when the values are integer-valued.

BeforeNow
zeros(ncells)zeros(Int, ncells)

Abstract type hierarchy renamed

Only relevant if you dispatched on these types directly.

BeforeNow
AbstractCAAbstractCellularAutomaton
AbstractRuleAbstractCellularAutomatonRule
AbstractODRuledimension/kind-specific subtype (see below)
AbstractTDRuledimension/kind-specific subtype (see below)
AbstractDCARuleAbstractDiscreteCellularAutomatonRule
AbstractCCARuleAbstractContinuousCellularAutomatonRule
AbstractTCARuleAbstractTotalisticCellularAutomatonRule
AbstractLifeRuleAbstractLifeLikeCellularAutomatonRule

New functional core: next_state/rollout

The callable interface (dca(state), life(state), ...) still works, but now delegates to next_state/rollout, which are the recommended entry points going forward and required for AD use.

BeforeNow
dca(state)next_state(dca, state) (or keep calling dca(state))
CellularAutomaton(rule, ic, n) looprollout(rule, ic, n; save=true) for a bare trajectory

Boundary conditions are now explicit

Previously periodic wraparound was hardcoded. It is now the Periodic() default of a new AbstractBoundaryCondition family, passed via the boundary keyword. Default behavior is unchanged unless you relied on internal helpers.

BeforeNow
(hardcoded periodic)next_state(rule, state; boundary=Periodic())
Reflecting() and ConstantBoundary(value) also available