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).
method is always "cholesky" for the minimal viable solver but stored
as a String for forward compatibility with future decomposition methods.
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: "cholesky".to_string(),
profiles,
schedule: vec![],
};
assert!(model.profiles.contains_key("default"));Fields§
§method: StringDecomposition method. Always "cholesky" for the minimal viable solver.
Stored as String for forward compatibility.
profiles: BTreeMap<String, CorrelationProfile>Named correlation profiles keyed by profile name.
BTreeMap for deterministic ordering (declaration-order invariance).
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
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more