Skip to content

A general-purpose stochastic simulation framework for timeline-based systems. Models outcomes driven by historical or synthetic data sequences, probabilistic variation, and defined failure states. Useful for finance, homesteading, livestock cycles, solar/battery resilience, and other sequential-risk domains.

License

Notifications You must be signed in to change notification settings

ginesthoii/ScenarioEngine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ScenarioEngine

ScenarioEngine is a general-purpose stochastic simulation framework for modeling timeline-based systems. It is designed for scenarios where outcomes depend on sequences of historical or synthetic data, probabilistic variation, and definitions of system failure.

This library is domain-agnostic and can be used for:

  • financial planning and sequence-of-returns risk
  • homestead and off-grid resource modeling
  • livestock production variability
  • renewable energy yield and battery depletion
  • cyber risk and uptime predictions
  • biological or behavioral simulations
  • any system that changes over time under uncertainty

Features

  • Continuous-window historical sampling
  • Optional wrap-around sampling
  • State-based step functions
  • Custom failure detection logic
  • Flexible duration distributions
  • Simple, composable API

Basic Example

from scenario_engine.engine import ScenarioEngine

data = [0.05, -0.02, 0.12]

initial = {“balance”: 100000}

def step_fn(state, r): state[“balance”] *= (1 + r) return state

def failure_fn(state): return state[“balance”] <= 0

years = lambda: 30

sim = ScenarioEngine(data, initial, step_fn, failure_fn, years) outcomes, failures = sim.run(50000)

Installation

Clone the repository: git clone https://github.com/ginesthoii/ScenarioEngine

About

A general-purpose stochastic simulation framework for timeline-based systems. Models outcomes driven by historical or synthetic data sequences, probabilistic variation, and defined failure states. Useful for finance, homesteading, livestock cycles, solar/battery resilience, and other sequential-risk domains.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages