Mapping

Handles discretization — the link between a concrete continuous state space and its finite abstract counterpart. A GridFree grid (centre x0, step hx) defines cells, an AbstractMapping is the bijection between integer state labels and cells, and cells are collected into state sets with an inclusion mode INNER / OUTER / CENTER. MappedStateSet is the public state-set surface; the concrete mappings trade memory for lookup speed.

API reference

Dionysos.Mapping.AbstractMappingType
AbstractMapping{N, T}

The concrete ↔ abstract discretization: a bijection between a universe of integer state labels 1:get_n_state(m) and points/cells of an N-dimensional concrete space (element type T).

Extending

Implement get_n_state, get_state_by_coord, get_states_by_coord, get_coord_by_state, get_elem_by_state, get_elem_by_coord, has_overlapping_cells. enum_states, enum_coords, enum_elems, is_valid_state, get_dim have generic defaults.

source
Dionysos.Mapping.AbstractMultiLevelMappingType
AbstractMultiLevelMapping{N, T} <: AbstractMapping{N, T}

A mapping whose labels are distributed across several resolution levels. Unlike a GridMapping, a position is a (level, pos) pair and the pos-based methods take an explicit level argument — so a multi-level mapping is deliberately not a GridMapping{N,T} (it does not satisfy the single-grid get_pos_by_state(m, q)::NTuple{N,Int} contract).

source
Dionysos.Mapping.AbstractStateSetType
AbstractStateSet{N}

A set of abstract states (integer labels) over an N-dimensional concrete space. The labels only have meaning relative to an AbstractMapping, which is why the membership/enumeration methods take the mapping m as an argument. For a self-contained object that bundles the set with its mapping, use MappedStateSet (the public surface); the (S, m, …) methods below are the implementation it forwards to.

Extending

Implement contains_state, enum_states, add_state!, remove_state!, empty_states!. get_n_state, add_states!, add_set!, remove_set! have generic defaults.

source
Dionysos.Mapping.FullStateSetType
FullStateSet{N} <: AbstractStateSet{N}

The read-only "all states" set: it contains every valid label of whatever AbstractMapping it is queried against (1:get_n_state(m)). Used as the default state set of a symbolic model ("consider every cell of the grid").

Note

Do not confuse FullStateSet (a state set covering the whole universe) with MappedStateSet (a bundle of an arbitrary state set together with its mapping).

source
Dionysos.Mapping.GridType
abstract type Grid{N, T} end

Defines an abstract type for grid-based structures in N dimensions with floating-point values T.

source
Dionysos.Mapping.GridEllipsoidalRectangularType
GridEllipsoidalRectangular{N,T} <: Grid{N,T}

Uniform grid on rectangular space rect, centered at orig and with steps set by the vector h. Cells are (possibly overlapping) ellipsoids defined at each grid point c as (x-c)'P(x-c) ≤ 1.

P (the quadratic form, hot membership loop) and its inverse Q (the LazySets shape matrix, cell construction) are both stored so neither path re-inverts.

source
Dionysos.Mapping.HierarchicalGridMappingType
HierarchicalGridMapping{N, T, ML} <: AbstractMultiLevelMapping{N, T}

Multiscale grid mapping with several levels of resolution; each level is itself a GridMapping (e.g. an ImplicitGridMapping). Global labels are assigned by concatenating the levels (offsets[l] is the number of labels before level l).

source
Dionysos.Mapping.ImplicitGridMappingType

ImplicitGridMapping:

  • universe is a rectangular index box (minpos..maxpos) possibly periodic
  • id computed by row-major linearization (no dict)
  • pos recovered by inverse mapping
source
Dionysos.Mapping.ImplicitStateSetType
ImplicitStateSet{N} <: AbstractStateSet{N}

A geometry-backed state set: membership is decided lazily from a stored LazySet and an inclusion mode, rather than from an explicit list of labels.

The set field is deliberately abstractly typed (LazySets.LazySet): the set is mutated in place through add_set!/remove_set!, and each operation may return a different concrete LazySet subtype (EmptySetUnionSetArrayIntersection, …), so the field cannot be a fixed concrete parameter.

source
Dionysos.Mapping.MappedStateSetType
MappedStateSet{N, S, M}

A state set bundled with the mapping that gives its integer labels meaning. Consumers hold one self-contained object instead of threading the (set, mapping) pair through every call — which also removes the "wrong mapping" bug class. This is the public surface for state sets; the (set, mapping, …) methods on AbstractStateSet are what it forwards to.

source
Dionysos.Mapping.PeriodicGridMappingType
PeriodicGridMapping{N, T, M, P} <: GridMapping{N, T}

A periodic wrapper over an underlying GridMapping.

Fields (mirrors PeriodicDomainList):

  • periodic_dims::SVector{P, Int}
  • periods::SVector{P, T}
  • start::SVector{P, T}
  • underlying_mapping::M
  • periodic_index_map::NTuple{N, Union{Nothing, Int}}
source
Dionysos.Mapping.get_pos_by_coordMethod
get_pos_by_coord(grid::Grid{N, T}, x::SVector{N, T}) -> NTuple{N, Int}

Returns the discrete position (grid indices) corresponding to a coordinate x.

  • The cell (0,0) is centered between -h/2 and +h/2.
  • h is the length of a grid cell in each dimension.
source