This example shows how a single severe event produces two effects: an immediate delta that decays, and a permanent base shift that changes who the person is. We model a betrayal event that reduces Agreeableness and increases Neuroticism.
The Scenario
An individual experiences a major betrayal. In BP terms, this is a formative event: it is intense enough to shift baseline personality traits, not just cause temporary emotional disturbance.
Step 1: Create the Entity
use behavioral_pathways::entity::EntityBuilder;
use behavioral_pathways::enums::{Species, HexacoPath, EventType};
use behavioral_pathways::event::EventBuilder;
use behavioral_pathways::simulation::Simulation;
use behavioral_pathways::types::Timestamp;
let person = EntityBuilder::new("riley", Species::Human)
.with_age(29)
.build();
let mut sim = Simulation::new();
let anchor = Timestamp::from_ymd_hms(2020, 1, 1, 0, 0, 0);
sim.add_entity(person, anchor);
Step 2: Apply the Formative Event
The betrayal shifts Agreeableness and Neuroticism. We use with_base_shift to encode permanent change.
// Severe betrayal permanently decreases Agreeableness and increases Neuroticism
let betrayal = EventBuilder::new(EventType::Betrayal)
.target("riley")
.severity(0.9)
.with_base_shift(HexacoPath::Agreeableness, -0.25)
.with_base_shift(HexacoPath::Neuroticism, 0.15)
.build()?;
sim.add_event(betrayal, Timestamp::from_ymd_hms(2020, 8, 1, 0, 0, 0));
Step 3: Query the Long-Term State
Months later, Riley's effective state reflects the permanent base shift.
let handle = sim.query_entity("riley");
let state = handle.state_at(Timestamp::from_ymd_hms(2021, 1, 1, 0, 0, 0));
println!("Agreeableness: {:.2}", state.personality().agreeableness_base());
println!("Neuroticism: {:.2}", state.personality().neuroticism_base());
Why This Matters
- Base shifts persist: The event changes the anchor baseline, not just short-term mood.
- Partial settling: Severe events settle to ~70% of their initial impact over time.
- Personality stability applies: Traits resist change based on their stability parameters.
Use formative events sparingly. Most events should create deltas only. Reserve base shifts for major life transitions, trauma, or long-term role changes.