1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
// ---------------- [ File: character-traits-warrior-capability/src/sampling_demo.rs ]
crate::ix!();
/* -------------------------------------------------------------------------- */
/* 2. NEW: exhaustive integration‑test showcasing environment‑driven sampling */
/* -------------------------------------------------------------------------- */
#[cfg(test)]
mod warrior_profile_sampling_demo {
use super::*;
use rand_chacha::ChaCha12Rng;
use rand::SeedableRng;
use tracing::{info, instrument};
/// Build an intrinsic‑dimension *space* tuned to the snowy‑river‑dome
/// environment and its characteristic skill list.
#[instrument(level = "trace")]
fn snowy_river_dome_space() -> Box<WarriorCapabilityIntrinsicDimensionRatings> {
Box::new(WarriorCapabilityIntrinsicDimensionRatingsBuilder::default()
/* -- strongly expressed traits inferred from skills & setting -- */
.agility(0.90) // parkour, gymnastics, balance
.survival_skill(0.85) // bushcraft, trapping, WFA
.environmental_protection(0.80) // pristine wilderness theme
.situational_awareness(0.75) // stealth, guerrilla tactics
.tempo_management(0.75) // swift‑water navigation
.patience(0.70) // meditation, tai‑chi, qigong
/* -- mild leadership / valor presence (heroic aura) ------------ */
.divine_valor_intensity(0.40)
.command_influence(0.35)
.build()
.unwrap())
}
#[instrument(level = "trace")]
fn class3() -> Box<WarriorCapabilityIntrinsicDimensionRatings> {
Box::new(WarriorCapabilityIntrinsicDimensionRatingsBuilder::default()
.moral_alignment(0.90)
.dominance(0.90)
.physical_potency(0.85)
.tactical_expertise(0.85)
.ruthlessness(0.95)
.build()
.unwrap())
}
#[traced_test]
#[instrument(level = "trace")]
fn sample_profiles_from_snowy_river_dome_space() {
/* ------------------------------------------------------------------ */
/* a) construct the probability space */
/* ------------------------------------------------------------------ */
//let space = snowy_river_dome_space();
let space = class3();
info!("space: {:#?}", space);
/* ------------------------------------------------------------------ */
/* b) configure the sampler */
/* ------------------------------------------------------------------ */
let sampler = WarriorProfileAdaptiveSamplerBuilder::default()
.target_fill(0.55)
.ess_target(6.0) // categories below this remain empty
.temp_bounds((0.05,4.0))
.build()
.unwrap();
/* ------------------------------------------------------------------ */
/* c) draw several independent samples */
/* ------------------------------------------------------------------ */
let mut rng = ChaCha12Rng::seed_from_u64(0xD0BE_0000);
let profiles: Vec<_> = (0..10)
.map(|_| sampler.sample_profile(&space, &mut rng))
.collect();
/* ------------------------------------------------------------------ */
/* d) inspect & sanity‑check */
/* ------------------------------------------------------------------ */
for (idx, prof) in profiles.iter().enumerate() {
info!(index = idx, "generated warrior capability profile: {:#?}", prof);
// Each profile must contain **at least one** set that reflects
// the emphasized intrinsic traits (agility or survival, etc.).
let hallmark_present =
!prof.physical().is_empty()
|| !prof.responsiveness().is_empty()
|| !prof.exploration().is_empty()
|| !prof.approach().is_empty()
|| !prof.offensive_magic().is_empty()
|| !prof.cyber_defense().is_empty();
assert!(
hallmark_present,
"profile {idx} lacked any hallmark capability sets"
);
}
assert_eq!(profiles.len(), 10);
assert!(false);
}
}