MEASUREMENT
Type-safe wrapper for measurement values (real or integer).
Creation
- make_real(a_value: REAL_64) - Create real-valued measurement
- make_integer(a_value: INTEGER) - Create integer-valued measurement
Access
- as_real: REAL_64 - Get value as real (promotes integer)
- as_integer: INTEGER - Get value as integer (truncates)
- is_real: BOOLEAN - Query which type stored
TRIAL_OUTCOME
Container for measurements from a single trial.
Creation
- make - Create empty outcome
Commands
- add_measurement(a_name: STRING; a_value: MEASUREMENT) - Record measurement
Queries
- count: INTEGER - Number of measurements
- has_measurement(a_name: STRING): BOOLEAN - Check existence
- measurement_at(a_name: STRING): MEASUREMENT - Retrieve by name
- all_measurements: ARRAYED_LIST[MEASUREMENT] - Get all measurements
SIMULATION_STATISTICS
Aggregated statistics from all trials.
Queries
- mean: REAL_64 - Arithmetic mean
- std_dev: REAL_64 - Standard deviation
- min: REAL_64 - Minimum value
- max: REAL_64 - Maximum value
- sample_size: INTEGER - Number of measurements
- ci_95: TUPLE[REAL_64, REAL_64] - 95% confidence interval
- ci_99: TUPLE[REAL_64, REAL_64] - 99% confidence interval
- confidence_interval(a_level: REAL_64): TUPLE[REAL_64, REAL_64] - Custom level
MONTE_CARLO_EXPERIMENT
Orchestrator for running trials and computing statistics.
Creation
- make(a_trial_count: INTEGER) - Create experiment with N trials
Configuration
- set_seed(a_seed: INTEGER) - Set random seed
- set_trial_logic(a_logic: PROCEDURE) - Define trial behavior
Execution
- run_simulation - Execute all trials and collect outcomes
Results
- outcome_count: INTEGER - Number of collected outcomes
- outcome_at(a_index: INTEGER): TRIAL_OUTCOME - Get outcome N
- statistics: SIMULATION_STATISTICS - Aggregated statistics