Skip to main content

character_traits_transformative_abilities/
intrinsic_dimension_ratings.rs

1// ---------------- [ File: character-traits-transformative-abilities/src/intrinsic_dimension_ratings.rs ]
2crate::ix!();
3
4/// Latent, orthogonal axes that locate every variant of
5/// `CoreTransformDomain` and `NuancedTransformAttribute` within the
6/// *conceptual* space of transformative capabilities.
7///
8/// Each axis is a **continuous value in [0.0, 1.0]**; larger values
9/// indicate stronger affinity with the upper‑bound pole described
10/// in the doc comments.
11///
12/// ┌────────────┬─────────────────────────────── 0.0 ───────► 1.0 ─────────────┐
13/// │ scope_scale│   purely personal …………… systemic / global                   │
14/// │ intangibility│ physical / tangible ……… intangible / conceptual            │
15/// │ engineered_source│   natural / emergent ……… engineered / artificial        │
16/// │ spirituality│   secular …………………… spiritual / mystical                   │
17/// │ authority_orientation│ participatory ………… authoritative / directive        │
18/// │ adaptivity│   rigid / directive ……… adaptive / evolutionary              │
19/// │ temporal_dynamics│ gradual …………………… sudden / instantaneous               │
20/// │ disruptiveness│ stabilising …………… disruptive / revolutionary             │
21/// │ complexity_focus│ linear …………………… complex / systemic                    │
22/// │ agency_orientation│ self‑oriented ………… empowers others                     │
23/// └────────────┴──────────────────────────────────────────────────────────────┘
24/// Compact rating vector used for every model enum in this crate.
25#[derive(Clone, Debug, Serialize, Deserialize, Builder, Getters)]
26#[builder(pattern = "owned")]
27#[getset(get = "pub")]
28pub struct TransformLatentDimensionRatings {
29    scope_scale:          f64,
30    intangibility:        f64,
31    engineered_source:    f64,
32    spirituality:         f64,
33    authority_orientation:f64,
34    adaptivity:           f64,
35    temporal_dynamics:    f64,
36    disruptiveness:       f64,
37    complexity_focus:     f64,
38    agency_orientation:   f64,
39}
40
41// -----------------------------------------------------------------------------
42//  Helper – macro & scaling
43// -----------------------------------------------------------------------------
44macro_rules! intrinsic_ratings {
45    (
46        $scope:expr, $intang:expr, $engineered:expr, $spirit:expr,
47        $auth:expr,  $adapt:expr,  $tempo:expr,      $disrupt:expr,
48        $complex:expr,$agency:expr
49    ) => {
50        TransformLatentDimensionRatingsBuilder::default()
51            .scope_scale(expand_spread($scope))
52            .intangibility(expand_spread($intang))
53            .engineered_source(expand_spread($engineered))
54            .spirituality(expand_spread($spirit))
55            .authority_orientation(expand_spread($auth))
56            .adaptivity(expand_spread($adapt))
57            .temporal_dynamics(expand_spread($tempo))
58            .disruptiveness(expand_spread($disrupt))
59            .complexity_focus(expand_spread($complex))
60            .agency_orientation(expand_spread($agency))
61            .build()
62            .unwrap()
63    };
64}
65
66/// Expands a rating from (0.5–1.0) to (0.3–1.0) but keeps 0.0 unchanged.
67fn expand_spread(value: f64) -> f64 {
68    if value == 0.0 {
69        return 0.0;
70    }
71    const OLD_MIN: f64 = 0.5;
72    const OLD_MAX: f64 = 1.0;
73    const NEW_MIN: f64 = 0.3;
74    const NEW_MAX: f64 = 1.0;
75
76    NEW_MIN + (value - OLD_MIN) * (NEW_MAX - NEW_MIN) / (OLD_MAX - OLD_MIN)
77}
78
79// -----------------------------------------------------------------------------
80//  Explicit intrinsic ratings for CoreTransformDomain
81// -----------------------------------------------------------------------------
82impl CoreTransformDomain {
83    pub fn intrinsic_ratings(&self) -> TransformLatentDimensionRatings {
84        use CoreTransformDomain::*;
85        match self {
86            PersonalGrowth       => intrinsic_ratings!(0.10, 0.70, 0.20, 0.60, 0.20, 0.80, 0.30, 0.60, 0.40, 0.20),
87            SocietalChange       => intrinsic_ratings!(0.90, 0.70, 0.40, 0.40, 0.60, 0.60, 0.50, 0.80, 0.80, 0.70),
88            ScientificProgress   => intrinsic_ratings!(0.80, 0.40, 0.90, 0.10, 0.50, 0.60, 0.70, 0.80, 0.80, 0.70),
89            SpiritualAwakening   => intrinsic_ratings!(0.40, 1.00, 0.30, 1.00, 0.30, 0.70, 0.50, 0.60, 0.60, 0.60),
90            LeadershipGovernance => intrinsic_ratings!(0.80, 0.60, 0.50, 0.20, 1.00, 0.40, 0.60, 0.70, 0.80, 0.90),
91            ArtisticCultural     => intrinsic_ratings!(0.60, 0.80, 0.40, 0.50, 0.40, 0.70, 0.60, 0.60, 0.60, 0.60),
92            EcologicalRenewal    => intrinsic_ratings!(0.70, 0.30, 0.60, 0.50, 0.40, 0.80, 0.40, 0.50, 0.90, 0.70),
93            StrategicMastery     => intrinsic_ratings!(0.70, 0.50, 0.60, 0.20, 0.90, 0.80, 0.70, 0.80, 0.70, 0.80),
94            AdaptationResilience => intrinsic_ratings!(0.60, 0.50, 0.50, 0.40, 0.50, 1.00, 0.60, 0.70, 0.70, 0.60),
95            Empowerment          => intrinsic_ratings!(0.60, 0.70, 0.40, 0.50, 0.70, 0.80, 0.50, 0.70, 0.60, 1.00),
96            None                 => TransformLatentDimensionRatingsBuilder::default()
97                                       .scope_scale(0.0)
98                                       .intangibility(0.0)
99                                       .engineered_source(0.0)
100                                       .spirituality(0.0)
101                                       .authority_orientation(0.0)
102                                       .adaptivity(0.0)
103                                       .temporal_dynamics(0.0)
104                                       .disruptiveness(0.0)
105                                       .complexity_focus(0.0)
106                                       .agency_orientation(0.0)
107                                       .build()
108                                       .unwrap(),
109        }
110    }
111}
112
113// -----------------------------------------------------------------------------
114//  Explicit intrinsic ratings for NuancedTransformAttribute
115// -----------------------------------------------------------------------------
116impl NuancedTransformAttribute {
117    pub fn intrinsic_ratings(&self) -> TransformLatentDimensionRatings {
118        use NuancedTransformAttribute::*;
119        match self {
120            Adaptation    => intrinsic_ratings!(0.50, 0.50, 0.40, 0.50, 0.50, 1.00, 0.60, 0.60, 0.70, 0.60),
121            Agency        => intrinsic_ratings!(0.60, 0.70, 0.40, 0.40, 0.70, 0.80, 0.60, 0.60, 0.60, 1.00),
122            Alchemy       => intrinsic_ratings!(0.50, 0.60, 0.60, 0.70, 0.50, 0.60, 0.50, 0.70, 0.70, 0.60),
123            Awakening     => intrinsic_ratings!(0.60, 0.90, 0.30, 1.00, 0.40, 0.80, 0.60, 0.70, 0.60, 0.70),
124            Challenge     => intrinsic_ratings!(0.70, 0.50, 0.50, 0.40, 0.70, 0.70, 0.70, 0.80, 0.70, 0.70),
125            Complexity    => intrinsic_ratings!(0.70, 0.60, 0.60, 0.50, 0.60, 0.70, 0.50, 0.70, 1.00, 0.60),
126            Conquest      => intrinsic_ratings!(0.90, 0.50, 0.50, 0.40, 1.00, 0.70, 0.80, 0.90, 0.80, 0.80),
127            Creativity    => intrinsic_ratings!(0.60, 0.80, 0.40, 0.60, 0.50, 0.70, 0.60, 0.60, 0.70, 0.60),
128            Destiny       => intrinsic_ratings!(0.80, 0.80, 0.30, 0.90, 0.60, 0.50, 0.50, 0.70, 0.80, 0.70),
129            Discovery     => intrinsic_ratings!(0.70, 0.60, 0.70, 0.40, 0.50, 0.80, 0.70, 0.70, 0.80, 0.70),
130            Diversity     => intrinsic_ratings!(0.80, 0.70, 0.40, 0.50, 0.40, 0.90, 0.50, 0.60, 0.80, 0.90),
131            Empathy       => intrinsic_ratings!(0.70, 0.90, 0.20, 0.80, 0.50, 0.80, 0.50, 0.50, 0.70, 0.90),
132            Enlightenment => intrinsic_ratings!(0.60, 1.00, 0.20, 1.00, 0.40, 0.80, 0.60, 0.60, 0.80, 0.80),
133            Evolution     => intrinsic_ratings!(0.80, 0.50, 0.60, 0.50, 0.60, 1.00, 0.70, 0.80, 0.90, 0.80),
134            Healing       => intrinsic_ratings!(0.60, 0.60, 0.40, 0.80, 0.40, 0.80, 0.50, 0.40, 0.60, 0.90),
135            Heritage      => intrinsic_ratings!(0.70, 0.70, 0.40, 0.60, 0.60, 0.60, 0.50, 0.60, 0.80, 0.70),
136            Innovation    => intrinsic_ratings!(0.80, 0.60, 1.00, 0.20, 0.60, 0.80, 0.80, 0.80, 0.80, 0.70),
137            Insight       => intrinsic_ratings!(0.70, 0.90, 0.30, 0.80, 0.50, 0.70, 0.40, 0.50, 0.70, 0.80),
138            Integration   => intrinsic_ratings!(0.80, 0.70, 0.50, 0.50, 0.60, 0.80, 0.50, 0.60, 0.90, 0.80),
139            Leadership    => intrinsic_ratings!(0.80, 0.60, 0.60, 0.30, 1.00, 0.60, 0.60, 0.70, 0.80, 0.90),
140            Mobility      => intrinsic_ratings!(0.70, 0.40, 0.60, 0.30, 0.60, 0.90, 0.80, 0.70, 0.70, 0.70),
141            Renewal       => intrinsic_ratings!(0.70, 0.60, 0.40, 0.70, 0.50, 0.80, 0.50, 0.50, 0.80, 0.80),
142            Resilience    => intrinsic_ratings!(0.60, 0.50, 0.40, 0.50, 0.60, 1.00, 0.50, 0.60, 0.80, 0.80),
143            Strategy      => intrinsic_ratings!(0.80, 0.60, 0.60, 0.30, 0.90, 0.80, 0.70, 0.80, 0.80, 0.80),
144            Unity         => intrinsic_ratings!(0.90, 0.80, 0.40, 0.60, 0.70, 0.80, 0.60, 0.60, 0.80, 1.00),
145            Vision        => intrinsic_ratings!(0.80, 0.90, 0.30, 0.80, 0.60, 0.70, 0.50, 0.60, 0.80, 0.90),
146        }
147    }
148}