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.AbstractMapping — Type
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.
Dionysos.Mapping.AbstractMultiLevelMapping — Type
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).
Dionysos.Mapping.AbstractStateSet — Type
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.
Dionysos.Mapping.ExplicitGridMapping — Type
ExplicitGridMapping: explicit enumeration of positions -> ids (dict) and ids -> positions (vector)
Dionysos.Mapping.ExplicitIdSet — Type
ExplicitIdSet{N} <: AbstractStateSet{N}A state set stored as an explicit BitSet of integer labels.
Dionysos.Mapping.FullStateSet — Type
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").
Do not confuse FullStateSet (a state set covering the whole universe) with MappedStateSet (a bundle of an arbitrary state set together with its mapping).
Dionysos.Mapping.Grid — Type
abstract type Grid{N, T} endDefines an abstract type for grid-based structures in N dimensions with floating-point values T.
Dionysos.Mapping.GridEllipsoidalRectangular — Type
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.
Dionysos.Mapping.GridFree — Type
GridFree{N,T} <: Grid{N,T}Uniform grid on unbounded space, centered at orig and with steps set by the vector h.
Dionysos.Mapping.GridMapping — Type
GridMapping{N,T} <: AbstractMapping{N,T}:
- adds grid, and pos <-> state conversions
Dionysos.Mapping.HierarchicalGridMapping — Type
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).
Dionysos.Mapping.ImplicitGridMapping — Type
ImplicitGridMapping:
- universe is a rectangular index box (minpos..maxpos) possibly periodic
- id computed by row-major linearization (no dict)
- pos recovered by inverse mapping
Dionysos.Mapping.ImplicitStateSet — Type
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 (EmptySet → UnionSetArray → Intersection, …), so the field cannot be a fixed concrete parameter.
Dionysos.Mapping.ListMapping — Type
ListMapping{N,T} <: AbstractMapping{N,T}Finite list of concrete points (SVector{N,T}) with id=1..K.
Dionysos.Mapping.MappedStateSet — Type
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.
Dionysos.Mapping.PeriodicGridMapping — Type
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::Mperiodic_index_map::NTuple{N, Union{Nothing, Int}}
Dionysos.Mapping.SetMinusStateSet — Type
SetMinusStateSet{N, S1, S2} <: AbstractStateSet{N}Lazy difference A ∖ B of two state sets.
Dionysos.Mapping.UnionStateSet — Type
UnionStateSet{N, S1, S2} <: AbstractStateSet{N}Lazy union A ∪ B of two state sets.
Dionysos.Mapping.get_pos_by_coord — Method
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/2and+h/2. his the length of a grid cell in each dimension.