pub enum SpaceTimeKind {
Euclidean(EuclideanSpacetime),
Lorentzian(LorentzianSpacetime),
Minkowski(MinkowskiSpacetime),
Tangent(TangentSpacetime),
}Expand description
A polymorphic enum over supported spacetime context types.
SpaceTimeKind provides a unified abstraction over multiple spacetime representations.
It enables algorithms to generically operate over different mathematical models of
space and time without requiring monomorphic type coupling.
This type implements key traits such as Coordinate, Temporal, Spatial, and
SpaceTemporal to enable high-level reasoning, measurement, and causal modeling in spacetime-aware systems.
§Supported Variants
EuclideanSpacetime: Classical Newtonian model with separate space and time.LorentzianSpacetime: Supports pseudo-Riemannian geometry, used in general relativity.MinkowskiSpacetime: Flat spacetime in special relativity, often used in causal graphs.TangentSpacetime: Linear approximation of curved space at a point (i.e., tangent space).
§Examples
use deep_causality::*;
let euclidean = EuclideanSpacetime::new(1, 0.0, 0.0, 0.0, 1.0, TimeScale::Second);
let spacetime = SpaceTimeKind::Euclidean(euclidean);
assert_eq!(spacetime.dimension(), 4);
assert_eq!(spacetime.time_unit(), 1.0);§Trait Support
SpaceTimeKind implements:
Identifiable: Unique ID for referencing entities.Coordinate<f64>: Spatial dimensionality and index access.Temporal<f64>: Temporal metadata and tick-based behavior.Spatial<f64>: Marker trait for spatial context.SpaceTemporal<f64, f64>: Full space-time reasoning abstraction.
§Index Mapping
Coordinate indexing depends on the inner type variant. The most common mapping is:
0 => x1 => y2 => z3 => t
§Notes
- This abstraction is ideal for heterogeneous systems that must support multiple physical or geometric models simultaneously (e.g., causal simulation engines, robotics frameworks, or time-aware decision systems).
Variants§
Euclidean(EuclideanSpacetime)
Classical Newtonian spacetime (ℝ³ + time)
Lorentzian(LorentzianSpacetime)
General relativistic curved spacetime
Minkowski(MinkowskiSpacetime)
Special relativistic flat spacetime (Minkowski space)
Tangent(TangentSpacetime)
Tangent space at a point, used for local linearization of curvature
Trait Implementations§
Source§impl Clone for SpaceTimeKind
impl Clone for SpaceTimeKind
Source§fn clone(&self) -> SpaceTimeKind
fn clone(&self) -> SpaceTimeKind
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more