deep_causality/types/alias_types/alias_base.rs
1/*
2 * SPDX-License-Identifier: MIT
3 * Copyright (c) "2025" . The DeepCausality Authors and Contributors. All Rights Reserved.
4 */
5
6// should prevent circular dependencies to / from prelude
7use crate::types::alias_types::alias_primitives::FloatType;
8use crate::types::causal_types::causaloid::Causaloid;
9use crate::types::causal_types::causaloid_graph::CausaloidGraph;
10use crate::types::context_node_types::data::Data;
11use crate::types::context_node_types::space::euclidean_space::EuclideanSpace;
12use crate::types::context_node_types::space_time::euclidean_spacetime::EuclideanSpacetime;
13use crate::types::context_node_types::symbol::base_symbol::BaseSymbol;
14use crate::types::context_node_types::time::euclidean_time::EuclideanTime;
15use crate::types::context_types::context_graph::Context;
16use crate::types::context_types::contextoid::Contextoid;
17use crate::types::model_types::model::Model;
18
19use crate::{NumericalValue, TeloidStore};
20use std::collections::HashMap;
21
22/// A type alias for the default `Model` configuration.
23///
24/// This alias represents a `Model` that operates with a standard set of generic
25/// parameters, making it suitable for common causal modeling scenarios that
26/// operate within a Euclidean and numerical framework.
27///
28/// Specifically, `BaseModel` is a `Model` parameterized as follows:
29///
30/// - **`Data<NumericalValue>`**: Used for its data component. `NumberType` is a
31/// generic numeric type, typically an alias for a floating-point or integer,
32/// allowing for flexible data representation within the model.
33/// - **`EuclideanSpace`**: Defines the spatial context. This implies that
34/// spatial relationships within this model adhere to standard 3D Euclidean geometry.
35/// - **`EuclideanTime`**: Specifies the temporal context, utilizing a
36/// Euclidean representation of time. This typically refers to a continuous,
37/// linear progression of time.
38/// - **`EuclideanSpacetime`**: Combines the Euclidean spatial and temporal
39/// contexts into a unified spacetime representation, where both space and
40/// time are treated with Euclidean properties.
41/// - **`BaseSymbol`**: Provides a basic symbolic representation for elements
42/// within the model, useful for labeling, identification, or abstract reasoning.
43/// - **`FloatType` (x2)**: Two `FloatType` parameters, typically used for
44/// internal calculations, scalar values, metrics, or other generic numerical
45/// requirements within the `Model` structure, such as probabilities, weights,
46/// or magnitudes.
47///
48/// This `BaseModel` is intended for general-purpose use cases where a standard
49/// Euclidean and numerical context is sufficient, offering a consistent and
50/// easily recognizable model structure for common causal reasoning and
51/// simulation scenarios.
52pub type BaseModel = Model<
53 Data<NumericalValue>,
54 EuclideanSpace,
55 EuclideanTime,
56 EuclideanSpacetime,
57 BaseSymbol,
58 FloatType,
59 FloatType,
60>;
61
62/// A type alias for a default, general-purpose `Causaloid` configuration.
63///
64/// This alias represents a `Causaloid`—a single, identity-bearing causal unit—
65/// configured with a standard set of generic parameters. It is designed for
66/// common causal modeling scenarios that operate within a Euclidean and numerical
67/// framework, providing a convenient and readable shorthand.
68///
69/// Each `BaseCausaloid` is parameterized with the following concrete types,
70/// defining its default context and data handling:
71///
72/// - **`Data<NumericalValue>`**: Represents the data component associated with the causaloid.
73/// `NumberType` is a generic numeric type, typically a floating-point or integer,
74/// allowing for flexible data representation.
75/// - **`EuclideanSpace`**: Defines the spatial context of the causaloid within a
76/// standard 3D Euclidean coordinate system. This implies that spatial relationships
77/// are governed by Euclidean geometry.
78/// - **`EuclideanTime`**: Specifies the temporal context, using a Euclidean
79/// representation of time. This typically refers to a continuous, linear progression
80/// of time.
81/// - **`EuclideanSpacetime`**: Combines the Euclidean spatial and temporal contexts
82/// into a unified spacetime representation, where both space and time are treated
83/// with Euclidean properties.
84/// - **`BaseSymbol`**: Provides a basic symbolic representation for the causaloid,
85/// useful for labeling, identification, or abstract reasoning.
86/// - **`FloatType` (x2)**: Two `FloatType` parameters, typically used for internal
87/// calculations, scalar values, or other generic numeric requirements within
88/// the `Causaloid` structure, such as probabilities, weights, or magnitudes.
89///
90/// This `BaseCausaloid` is the standard choice for creating individual causal nodes
91/// that are compatible with other "base" types like `BaseCausalGraph` and `BaseContext`,
92/// ensuring a consistent and easily understandable modeling environment.
93pub type BaseCausaloid = Causaloid<
94 Data<NumericalValue>,
95 EuclideanSpace,
96 EuclideanTime,
97 EuclideanSpacetime,
98 BaseSymbol,
99 FloatType,
100 FloatType,
101>;
102
103/// A type alias for a `Vec` (vector) containing `BaseCausaloid` instances.
104///
105/// This alias provides a convenient shorthand for a collection of causaloids,
106/// where each causaloid adheres to a standard "base" configuration. It's designed
107/// to represent an ordered list of `Causaloid` instances that share a common
108/// set of generic parameters, making it suitable for scenarios where multiple
109/// causaloids need to be grouped or processed together.
110///
111/// Each `Causaloid` within this vector is parameterized with the following
112/// concrete types, defining its default context and data handling:
113///
114/// - **`Data<NumericalValue>`**: Represents the data component associated with each causaloid.
115/// `NumberType` is a generic numeric type, typically a floating-point or integer,
116/// allowing for flexible data representation.
117/// - **`EuclideanSpace`**: Defines the spatial context of the causaloids within a
118/// standard 3D Euclidean coordinate system. This implies that spatial relationships
119/// are governed by Euclidean geometry.
120/// - **`EuclideanTime`**: Specifies the temporal context, using a Euclidean
121/// representation of time. This typically refers to a continuous, linear progression
122/// of time.
123/// - **`EuclideanSpacetime`**: Combines the Euclidean spatial and temporal contexts
124/// into a unified spacetime representation, where both space and time are treated
125/// with Euclidean properties.
126/// - **`BaseSymbol`**: Provides a basic symbolic representation for the causaloids,
127/// useful for labeling, identification, or abstract reasoning.
128/// - **`FloatType` (x2)**: Two `FloatType` parameters, typically used for internal
129/// calculations, scalar values, or other generic numeric requirements within
130/// the `Causaloid` structure, such as probabilities, weights, or magnitudes.
131///
132/// This `BaseCausaloidVec` is suitable for general-purpose use cases where a standard
133/// Euclidean and numerical context is sufficient for defining and managing ordered
134/// collections of causal entities. It offers a consistent and easily recognizable
135/// way to organize causaloids for common causal modeling scenarios, such as
136/// representing a sequence of events or a set of related causal agents.
137pub type BaseCausaloidVec = Vec<
138 Causaloid<
139 Data<NumericalValue>,
140 EuclideanSpace,
141 EuclideanTime,
142 EuclideanSpacetime,
143 BaseSymbol,
144 FloatType,
145 FloatType,
146 >,
147>;
148
149/// A type alias for a `HashMap` that stores `BaseCausaloid` instances, typically indexed by their unique identifiers.
150///
151/// This alias provides a convenient shorthand for a collection of causaloids,
152/// where each causaloid adheres to a standard "base" configuration. It's designed
153/// to represent a mapping from an integer ID (e.g., a node index or a unique identifier)
154/// to a `Causaloid` instance.
155///
156/// The `BaseCausaloid` type, which forms the value of this map, is parameterized
157/// with the following concrete types:
158///
159/// - **`Data<NumericalValue>`**: Represents the data component associated with each causaloid.
160/// `NumberType` is a generic numeric type, typically a floating-point or integer.
161/// - **`EuclideanSpace`**: Defines the spatial context of the causaloids within a
162/// standard Euclidean coordinate system.
163/// - **`EuclideanTime`**: Specifies the temporal context, using a Euclidean
164/// representation of time.
165/// - **`EuclideanSpacetime`**: Combines the Euclidean spatial and temporal contexts
166/// into a unified spacetime representation.
167/// - **`BaseSymbol`**: Provides a basic symbolic representation for the causaloids.
168/// - **`FloatType` (x2)**: Two `FloatType` parameters, typically used for internal
169/// calculations, scalar values, or other generic numeric requirements within
170/// the `Causaloid` structure.
171///
172/// This `BaseCausalMap` is suitable for general-purpose use cases where a standard
173/// Euclidean and numerical context is sufficient for defining and managing causal
174/// entities within a map structure. It offers a consistent and easily recognizable
175/// way to organize causaloids for common causal modeling scenarios.
176pub type BaseCausalMap = HashMap<
177 usize,
178 Causaloid<
179 Data<NumericalValue>,
180 EuclideanSpace,
181 EuclideanTime,
182 EuclideanSpacetime,
183 BaseSymbol,
184 FloatType,
185 FloatType,
186 >,
187>;
188
189/// A type alias for a `CausaloidGraph` composed of `BaseCausaloid` instances.
190///
191/// This alias provides a convenient shorthand for defining a causal graph where
192/// each node (causaloid) adheres to a standard "base" configuration.
193///
194/// Specifically, `BaseCausalGraph` is a `CausaloidGraph` parameterized by a `Causaloid`
195/// that uses the following concrete types for its generic parameters:
196/// - **`Data<NumericalValue>`**: Represents the data associated with each causaloid,
197/// using a generic `NumberType` (typically a floating-point or integer type).
198/// - **`EuclideanSpace`**: Defines the spatial context of the causaloids within
199/// a standard Euclidean coordinate system.
200/// - **`EuclideanTime`**: Specifies the temporal context, using a Euclidean
201/// representation of time.
202/// - **`EuclideanSpacetime`**: Combines the Euclidean spatial and temporal
203/// contexts into a unified spacetime representation.
204/// - **`BaseSymbol`**: Provides a basic symbolic representation for the causaloids.
205/// - **`FloatType` (x2)**: Two `FloatType` parameters, typically used for internal
206/// calculations, scalar values, or other generic numeric requirements within
207/// the `Causaloid` structure.
208///
209/// This `BaseCausalGraph` is designed for general-purpose use cases where a
210/// standard Euclidean and numerical context is sufficient, offering a consistent
211/// and easily recognizable graph structure for common causal modeling scenarios.
212pub type BaseCausalGraph = CausaloidGraph<
213 Causaloid<
214 Data<NumericalValue>,
215 EuclideanSpace,
216 EuclideanTime,
217 EuclideanSpacetime,
218 BaseSymbol,
219 FloatType,
220 FloatType,
221 >,
222>;
223
224/// A type alias for a default, general-purpose `Context` configuration.
225///
226/// This `BaseContext` alias represents a `Context` instance specifically configured
227/// with a standard set of generic parameters, making it suitable for common
228/// causal modeling scenarios that operate within a Euclidean and numerical framework.
229///
230/// It provides a convenient and readable shorthand for defining a `Context`
231/// that encapsulates:
232///
233/// - **`Data<NumericalValue>`**: For handling general numerical data. `NumberType`
234/// is typically an alias for a floating-point or integer type, allowing for
235/// flexible data representation within the context.
236/// - **`EuclideanSpace`**: Defines the spatial context using a standard
237/// Euclidean coordinate system. This implies that spatial relationships
238/// within this context adhere to Euclidean geometry.
239/// - **`EuclideanTime`**: Specifies the temporal context, utilizing a
240/// Euclidean representation of time. This typically refers to a continuous,
241/// linear progression of time.
242/// - **`EuclideanSpacetime`**: Combines the Euclidean spatial and temporal
243/// contexts into a unified spacetime representation, where both space and
244/// time are treated with Euclidean properties.
245/// - **`BaseSymbol`**: Provides a basic symbolic representation for elements
246/// within the context, useful for labeling, identification, or abstract
247/// reasoning.
248/// - **`FloatType` (x2)**: Two `FloatType` parameters, which are typically
249/// used for internal calculations, scalar values, metrics, or other generic
250/// numerical requirements within the `Context` structure, such as probabilities,
251/// weights, or magnitudes.
252///
253/// This `BaseContext` is designed to be a sensible default for many applications,
254/// offering a consistent and easily recognizable context structure for
255/// general-purpose causal reasoning and data representation.
256pub type BaseContext = Context<
257 Data<NumericalValue>,
258 EuclideanSpace,
259 EuclideanTime,
260 EuclideanSpacetime,
261 BaseSymbol,
262 FloatType,
263 FloatType,
264>;
265
266/// A type alias for a default, general-purpose `Contextoid` configuration.
267///
268/// This `BaseContextoid` alias represents a `Contextoid` instance—a single,
269/// identity-bearing unit of context—configured with a standard set of generic
270/// parameters. It is designed for common causal modeling scenarios that operate
271/// within a Euclidean and numerical framework.
272///
273/// It provides a convenient and readable shorthand for defining a `Contextoid`
274/// that encapsulates one of the following contextual roles:
275///
276/// - **`Data<NumericalValue>`**: For handling general numerical data (a `Datoid`). `NumberType`
277/// is typically an alias for a floating-point or integer type.
278/// - **`EuclideanSpace`**: Defines a spatial context using a standard
279/// Euclidean coordinate system (a `Spaceoid`).
280/// - **`EuclideanTime`**: Specifies a temporal context, utilizing a
281/// Euclidean representation of time (a `Tempoid`).
282/// - **`EuclideanSpacetime`**: Combines the Euclidean spatial and temporal
283/// contexts into a unified spacetime representation (a `SpaceTempoid`).
284/// - **`BaseSymbol`**: Provides a basic symbolic representation for elements
285/// within the context (a `Symboid`).
286///
287/// The two `FloatType` parameters correspond to the generic `VS` and `VT` types
288/// required by the underlying `Contextoid` structure, representing the value types
289/// for spatial and temporal coordinates, respectively.
290///
291/// This `BaseContextoid` is the standard choice for creating individual context nodes
292/// that are compatible with other "base" types like `BaseContext` and `BaseCausalGraph`,
293/// ensuring a consistent and easily understandable modeling environment.
294pub type BaseContextoid = Contextoid<
295 Data<NumericalValue>,
296 EuclideanSpace,
297 EuclideanTime,
298 EuclideanSpacetime,
299 BaseSymbol,
300 FloatType,
301 FloatType,
302>;
303
304/// A type alias for a default, general-purpose `TeloidStore` configuration.
305///
306/// This `BaseTeloidStore` alias represents a `TeloidStore` instance—a specialized
307/// data structure for managing and querying teloids (temporal causal units)—
308/// configured with a standard set of generic parameters. It is designed for
309/// common causal modeling scenarios that operate within a Euclidean and numerical
310/// framework.
311///
312/// It provides a convenient and readable shorthand for defining a `TeloidStore`
313/// that encapsulates:
314///
315/// - **`Data<NumericalValue>`**: For handling general numerical data associated with teloids.
316/// `NumberType` is typically an alias for a floating-point or integer type,
317/// allowing for flexible data representation.
318/// - **`EuclideanSpace`**: Defines the spatial context of the teloids using a standard
319/// Euclidean coordinate system. This implies that spatial relationships
320/// within this store adhere to Euclidean geometry.
321/// - **`EuclideanTime`**: Specifies the temporal context, utilizing a
322/// Euclidean representation of time. This typically refers to a continuous,
323/// linear progression of time.
324/// - **`EuclideanSpacetime`**: Combines the Euclidean spatial and temporal
325/// contexts into a unified spacetime representation, where both space and
326/// time are treated with Euclidean properties.
327/// - **`BaseSymbol`**: Provides a basic symbolic representation for teloids
328/// within the store, useful for labeling, identification, or abstract
329/// reasoning.
330/// - **`FloatType` (x2)**: Two `FloatType` parameters, which are typically
331/// used for internal calculations, scalar values, metrics, or other generic
332/// numerical requirements within the `TeloidStore` structure, such as probabilities,
333/// weights, or magnitudes.
334///
335/// This `BaseTeloidStore` is designed to be a sensible default for many applications,
336/// offering a consistent and easily recognizable structure for managing and
337/// querying temporal causal data in general-purpose causal reasoning and
338/// simulation scenarios.
339pub type BaseTeloidStore = TeloidStore<
340 Data<NumericalValue>,
341 EuclideanSpace,
342 EuclideanTime,
343 EuclideanSpacetime,
344 BaseSymbol,
345 FloatType,
346 FloatType,
347>;