pub trait Uncomputed<SolId, Dom, SInfo>{
type TwinUC<B: Domain>: Uncomputed<SolId, B, SInfo, Twin<Dom> = Self, TwinUC<Dom> = Self>;
// Required methods
fn twin<B: Domain>(
&self,
x: <Self::TwinUC<B> as Solution<SolId, B, SInfo>>::Raw,
) -> Self::TwinUC<B>;
fn new<T>(id: SolId, x: T, info: Arc<SInfo>) -> Self
where T: Into<Self::Raw>;
fn default(info: Arc<SInfo>, size: usize) -> Self;
fn default_vec(info: Arc<SInfo>, size: usize, vsize: usize) -> Vec<Self>;
}Expand description
Trait for solutions that have not yet been evaluated.
Uncomputed represents solutions generated by sampling or optimization but not yet
evaluated by the objective function. These solutions can be converted to Computed
solutions via the IntoComputed trait and a TypeCodom.
§Type Parameters
SolId- The unique identifier typeDom- The domain defining variable types and constraintsSInfo- The solution metadata type
§Lifecycle
Uncomputed --[evaluate]-> Computed
^ |
| |
TypeCodom <--+------[extract]--------+§Builder methods
Uncomputed provides multiple ways to create solutions:
new- From explicit valuesdefault- Placeholder with zero/default valuesdefault_vec- Batch of placeholders
Required Associated Types§
Sourcetype TwinUC<B: Domain>: Uncomputed<SolId, B, SInfo, Twin<Dom> = Self, TwinUC<Dom> = Self>
type TwinUC<B: Domain>: Uncomputed<SolId, B, SInfo, Twin<Dom> = Self, TwinUC<Dom> = Self>
The uncomputed twin type in an alternative domain.
Unlike Twin, this always produces an Uncomputed solution,
preserving the uncomputed status across domain transformations.
Required Methods§
Sourcefn twin<B: Domain>(
&self,
x: <Self::TwinUC<B> as Solution<SolId, B, SInfo>>::Raw,
) -> Self::TwinUC<B>
fn twin<B: Domain>( &self, x: <Self::TwinUC<B> as Solution<SolId, B, SInfo>>::Raw, ) -> Self::TwinUC<B>
Sourcefn default_vec(info: Arc<SInfo>, size: usize, vsize: usize) -> Vec<Self>
fn default_vec(info: Arc<SInfo>, size: usize, vsize: usize) -> Vec<Self>
Creates a vector of placeholder uncomputed solutions.
Batch version of default for initializing collections.
§Parameters
info- Shared solution metadatasize- Number of variables per solution (dimension)vsize- Number of solutions to create
§Returns
A vector of vsize uncomputed solutions, each with size default values.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".