pub trait GenerativeProcessor<D, S, T, ST, SYM, VS, VT, G>where
D: Default + Datable + Copy + Clone + Hash + Eq + PartialEq,
S: Spatial<VS> + Clone,
T: Temporal<VT> + Clone,
ST: SpaceTemporal<VS, VT> + Clone,
SYM: Symbolic + Clone,
VS: Clone,
VT: Clone,
G: Generatable<D, S, T, ST, SYM, VS, VT, G>,{
// Required methods
fn get_causaloid_dest(
&mut self,
) -> &mut Option<Causaloid<D, S, T, ST, SYM, VS, VT>>;
fn get_context_dest(
&mut self,
) -> &mut Option<Context<D, S, T, ST, SYM, VS, VT>>;
// Provided method
fn process_output(
&mut self,
output: GenerativeOutput<D, S, T, ST, SYM, VS, VT, G>,
) -> Result<(), ModelValidationError> { ... }
}
Expand description
A trait for types that can process the output of a Generatable
instance.
It defines the required state for the processing (a destination for the Causaloid and Context) and provides a default implementation for the processing logic itself, making it highly reusable.
Required Methods§
Sourcefn get_causaloid_dest(
&mut self,
) -> &mut Option<Causaloid<D, S, T, ST, SYM, VS, VT>>
fn get_causaloid_dest( &mut self, ) -> &mut Option<Causaloid<D, S, T, ST, SYM, VS, VT>>
Provides mutable access to the destination for the generated Causaloid. This is a required method for the trait implementor.
Sourcefn get_context_dest(&mut self) -> &mut Option<Context<D, S, T, ST, SYM, VS, VT>>
fn get_context_dest(&mut self) -> &mut Option<Context<D, S, T, ST, SYM, VS, VT>>
Provides mutable access to the destination for the generated Context. This is a required method for the trait implementor.
Provided Methods§
Sourcefn process_output(
&mut self,
output: GenerativeOutput<D, S, T, ST, SYM, VS, VT, G>,
) -> Result<(), ModelValidationError>
fn process_output( &mut self, output: GenerativeOutput<D, S, T, ST, SYM, VS, VT, G>, ) -> Result<(), ModelValidationError>
Processes a single GenerativeOutput
command, mutating the state provided
by the getter methods.
This method has a default implementation, providing reusable processing logic to any type that implements this trait.