Skip to content

Balance challenge vs hindrance stress events with binomial distribution #29

@lamurian

Description

@lamurian

User Story

As a developer, I want the ratio of challenge and hindrance stress events to be balanced so that resilience growth does not unrealistically saturate to 1.0 due to overrepresentation of challenge stress.

Description

Currently, the model produces too many challenge stress events, leading to excessive resilience increase and eventual saturation at 1.0. To correct this imbalance, stress events should be classified as challenge or hindrance with equal probability. This can be implemented using a binomial distribution with p=0.5 for each event. This ensures an equal chance of either type of stress, creating a more realistic stress-resilience dynamic.

Proposed Flow

  • Update stress event generation logic in src/python/model.py (or relevant module):
    • Use np.random.binomial(1, 0.5) to assign challenge (1) or hindrance (0)
    • Replace existing bias toward challenge stress
  • Ensure challenge and hindrance stress are equally probable across agents and iterations
  • Update tests to:
    • Verify approximate 50/50 distribution across large number of simulations
    • Confirm resilience no longer saturates to 1.0 under balanced stress exposure
  • Validate integration with existing affect and resilience update mechanisms

Reference

  • Current stress event assignment logic in the model
  • Observed issue: resilience steadily rising to 1.0
  • Binomial distribution: np.random.binomial(1, 0.5) for fair assignment

Notes:

  • Ensure reproducibility by seeding random generator from model configuration.
  • Long-run simulations should show stable resilience levels, not monotonic increase.
  • Consider adding a configuration parameter for CHALLENGE_PROBABILITY in .env for flexibility, with default 0.5.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions