pub struct CorrelationModel {
pub method: String,
pub profiles: BTreeMap<String, CorrelationProfile>,
pub schedule: Vec<CorrelationScheduleEntry>,
}Expand description
Top-level correlation configuration for the scenario pipeline.
Holds all named correlation profiles and the optional stage-to-profile
schedule. When schedule is empty, the solver uses a single profile
(typically named "default") for all stages.
profiles uses BTreeMap rather than HashMap to preserve
deterministic iteration order, satisfying the declaration-order
invariance requirement (design-principles.md §3).
Source: correlation.json.
See Input Scenarios §5 and
internal-structures.md §14.
§Examples
use std::collections::BTreeMap;
use cobre_core::{EntityId, scenario::{
CorrelationEntity, CorrelationGroup, CorrelationModel, CorrelationProfile,
CorrelationScheduleEntry,
}};
let mut profiles = BTreeMap::new();
profiles.insert("default".to_string(), CorrelationProfile {
groups: vec![CorrelationGroup {
name: "All".to_string(),
entities: vec![
CorrelationEntity { entity_type: "inflow".to_string(), id: EntityId(1) },
],
matrix: vec![vec![1.0]],
}],
});
let model = CorrelationModel {
method: "spectral".to_string(),
profiles,
schedule: vec![],
};
assert!(model.profiles.contains_key("default"));Fields§
§method: StringDecomposition method ("spectral").
String, not an enum, to keep old case files forward-compatible.
profiles: BTreeMap<String, CorrelationProfile>Named correlation profiles keyed by profile name.
schedule: Vec<CorrelationScheduleEntry>Stage-to-profile schedule. Empty when a single profile applies to all stages.
Trait Implementations§
Source§impl Clone for CorrelationModel
impl Clone for CorrelationModel
Source§fn clone(&self) -> CorrelationModel
fn clone(&self) -> CorrelationModel
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CorrelationModel
impl Debug for CorrelationModel
Source§impl Default for CorrelationModel
impl Default for CorrelationModel
Source§impl PartialEq for CorrelationModel
impl PartialEq for CorrelationModel
impl StructuralPartialEq for CorrelationModel
Auto Trait Implementations§
impl Freeze for CorrelationModel
impl RefUnwindSafe for CorrelationModel
impl Send for CorrelationModel
impl Sync for CorrelationModel
impl Unpin for CorrelationModel
impl UnsafeUnpin for CorrelationModel
impl UnwindSafe for CorrelationModel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more