pub struct PulseBehavior { /* private fields */ }Expand description
The single behavior: PULSE
A pulse is a basic operation that consumes energy. The pulse must be executed with sufficient energy or it causes strain.
CONSEQUENCE: Weak pulses cause permanent strain scars. CONSEQUENCE: Strain scars increase future pulse costs.
Implementations§
Source§impl PulseBehavior
impl PulseBehavior
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates the pulse behavior with fixed parameters.
INVARIANT: Threshold and cost are permanent and non-configurable.
Sourcepub fn execute_pulse(&self, lineage: &mut Lineage) -> PulseOutput
pub fn execute_pulse(&self, lineage: &mut Lineage) -> PulseOutput
Executes a single pulse.
CONTRACT: Pulse must be executed with energy >= threshold. CONSEQUENCE: If energy < threshold during pulse, strain occurs. CONSEQUENCE: Strain inflicts a permanent scar. CONSEQUENCE: Each strain scar increases future pulse cost by 5.
This demonstrates:
- Behavior consumes energy
- Contract is checked based on observable state
- Violation triggers injury, not correction
- Scar permanently reduces capability
Sourcepub fn current_pulse_cost(&self, lineage: &Lineage) -> u64
pub fn current_pulse_cost(&self, lineage: &Lineage) -> u64
Returns the current pulse cost based on accumulated strain.
This demonstrates how scars reduce capability:
- 0 strain scars: cost = 10
- 1 strain scar: cost = 15
- 2 strain scars: cost = 20
- etc.