@@ -12,7 +12,7 @@ Quick links:
1212- [ CLI Reference] ( cli.md )
1313- [ DSL Reference] ( dsl.md )
1414
15- Generated from source code on: December 20, 2025 at 00:19 UTC
15+ Generated from source code on: December 20, 2025 at 04:32 UTC
1616
1717Modules auto-discovered: 49
1818
@@ -635,7 +635,7 @@ Attributes:
635635
636636** Methods:**
637637
638- - ` apply_failures(self, network_nodes: 'Dict[str, Any]', network_links: 'Dict[str, Any]', network_risk_groups: 'Dict[str, Any] | None' = None, *, seed: 'Optional[int]' = None) -> 'List[str]' ` - Identify which entities fail for this iteration.
638+ - ` apply_failures(self, network_nodes: 'Dict[str, Any]', network_links: 'Dict[str, Any]', network_risk_groups: 'Dict[str, Any] | None' = None, *, seed: 'Optional[int]' = None, failure_trace: 'Optional[Dict[str, Any]]' = None ) -> 'List[str]' ` - Identify which entities fail for this iteration.
639639- ` to_dict(self) -> 'Dict[str, Any]' ` - Convert to dictionary for JSON serialization.
640640
641641### FailureRule
@@ -1114,6 +1114,9 @@ MaxFlow workflow step.
11141114Monte Carlo analysis of maximum flow capacity between node groups using FailureManager.
11151115Produces unified ` flow_results ` per iteration under ` data.flow_results ` .
11161116
1117+ Baseline (no failures) is always run first as a separate reference. The ` iterations `
1118+ parameter specifies how many failure scenarios to run.
1119+
11171120YAML Configuration Example:
11181121
11191122 workflow:
@@ -1130,7 +1133,6 @@ YAML Configuration Example:
11301133 shortest_path: false
11311134 require_capacity: true # false for true IP/IGP semantics
11321135 flow_placement: "PROPORTIONAL"
1133- baseline: false
11341136 seed: 42
11351137 store_failure_patterns: false
11361138 include_flow_details: false # cost_distribution
@@ -1140,18 +1142,21 @@ YAML Configuration Example:
11401142
11411143Maximum flow Monte Carlo workflow step.
11421144
1145+ Baseline (no failures) is always run first as a separate reference. Results are
1146+ returned with baseline in a separate field, and failure iterations in a 0-indexed
1147+ list that corresponds 1:1 with failure_patterns.
1148+
11431149Attributes:
11441150 source: Source node selector (string path or selector dict).
11451151 sink: Sink node selector (string path or selector dict).
11461152 mode: Flow analysis mode ("combine" or "pairwise").
11471153 failure_policy: Name of failure policy in scenario.failure_policy_set.
1148- iterations: Number of Monte Carlo trials .
1154+ iterations: Number of failure iterations to run .
11491155 parallelism: Number of parallel worker processes.
11501156 shortest_path: Whether to use shortest paths only.
11511157 require_capacity: If True (default), path selection considers capacity.
11521158 If False, path selection is cost-only (true IP/IGP semantics).
11531159 flow_placement: Flow placement strategy.
1154- baseline: Whether to run first iteration without failures as baseline.
11551160 seed: Optional seed for reproducible results.
11561161 store_failure_patterns: Whether to store failure patterns in results.
11571162 include_flow_details: Whether to collect cost distribution per flow.
@@ -1171,7 +1176,6 @@ Attributes:
11711176- ` shortest_path ` (bool) = False
11721177- ` require_capacity ` (bool) = True
11731178- ` flow_placement ` (FlowPlacement | str) = 1
1174- - ` baseline ` (bool) = False
11751179- ` store_failure_patterns ` (bool) = False
11761180- ` include_flow_details ` (bool) = False
11771181- ` include_min_cut ` (bool) = False
@@ -1309,17 +1313,23 @@ TrafficMatrixPlacement workflow step.
13091313Runs Monte Carlo demand placement using a named traffic matrix and produces
13101314unified ` flow_results ` per iteration under ` data.flow_results ` .
13111315
1316+ Baseline (no failures) is always run first as a separate reference. The ` iterations `
1317+ parameter specifies how many failure scenarios to run.
1318+
13121319### TrafficMatrixPlacement
13131320
13141321Monte Carlo demand placement using a named traffic matrix.
13151322
1323+ Baseline (no failures) is always run first as a separate reference. Results are
1324+ returned with baseline in a separate field, and failure iterations in a 0-indexed
1325+ list that corresponds 1:1 with failure_patterns.
1326+
13161327Attributes:
13171328 matrix_name: Name of the traffic matrix to analyze.
13181329 failure_policy: Optional policy name in scenario.failure_policy_set.
1319- iterations: Number of Monte Carlo iterations.
1330+ iterations: Number of failure iterations to run .
13201331 parallelism: Number of parallel worker processes.
13211332 placement_rounds: Placement optimization rounds (int or "auto").
1322- baseline: Include baseline iteration without failures first.
13231333 seed: Optional seed for reproducibility.
13241334 store_failure_patterns: Whether to store failure pattern results.
13251335 include_flow_details: When True, include cost_distribution per flow.
@@ -1338,7 +1348,6 @@ Attributes:
13381348- ` iterations ` (int) = 1
13391349- ` parallelism ` (int | str) = auto
13401350- ` placement_rounds ` (int | str) = auto
1341- - ` baseline ` (bool) = False
13421351- ` store_failure_patterns ` (bool) = False
13431352- ` include_flow_details ` (bool) = False
13441353- ` include_used_edges ` (bool) = False
@@ -1968,8 +1977,14 @@ Args:
19681977Container for per-iteration analysis results.
19691978
19701979Args:
1971- failure_id: Stable identifier for the failure scenario (e.g., "baseline" or a hash).
1980+ failure_id: Stable identifier for the failure scenario (hash of excluded
1981+ components, or "" for no exclusions).
19721982 failure_state: Optional excluded components for the iteration.
1983+ failure_trace: Optional trace info (mode_index, selections, expansion) when
1984+ store_failure_patterns=True. None for baseline or when tracing disabled.
1985+ occurrence_count: Number of Monte Carlo iterations that produced this exact
1986+ failure pattern. Used with deduplication to avoid re-running identical
1987+ analyses. Defaults to 1.
19731988 flows: List of flow entries for this iteration.
19741989 summary: Aggregated summary across `` flows `` .
19751990 data: Optional per-iteration extras.
@@ -1978,6 +1993,8 @@ Args:
19781993
19791994- ` failure_id ` (str)
19801995- ` failure_state ` (Optional[ Dict[ str, List[ str]]] )
1996+ - ` failure_trace ` (Optional[ Dict[ str, Any]] )
1997+ - ` occurrence_count ` (int) = 1
19811998- ` flows ` (List[ FlowEntry] ) = [ ]
19821999- ` summary ` (FlowSummary) = FlowSummary(total_demand=0.0, total_placed=0.0, overall_ratio=1.0, dropped_flows=0, num_flows=0)
19832000- ` data ` (Dict[ str, Any] ) = {}
@@ -2801,12 +2818,12 @@ Attributes:
28012818
28022819** Methods:**
28032820
2804- - ` compute_exclusions(self, policy: "'FailurePolicy | None'" = None, seed_offset: 'int | None' = None) -> 'tuple[set[str], set[str]]' ` - Compute set of nodes and links to exclude for a failure iteration.
2821+ - ` compute_exclusions(self, policy: "'FailurePolicy | None'" = None, seed_offset: 'int | None' = None, failure_trace: 'Optional[Dict[str, Any]]' = None ) -> 'tuple[set[str], set[str]]' ` - Compute set of nodes and links to exclude for a failure iteration.
28052822- ` get_failure_policy(self) -> "'FailurePolicy | None'" ` - Get failure policy for analysis.
2806- - ` run_demand_placement_monte_carlo(self, demands_config: 'list[dict[str, Any]] | Any', iterations: 'int' = 100, parallelism: 'int' = 1, placement_rounds: 'int | str' = 'auto', baseline: 'bool' = False, seed: 'int | None' = None, store_failure_patterns: 'bool' = False, include_flow_details: 'bool' = False, include_used_edges: 'bool' = False, **kwargs) -> 'Any' ` - Analyze traffic demand placement success under failures.
2807- - ` run_max_flow_monte_carlo(self, source: 'str | dict[str, Any]', sink: 'str | dict[str, Any]', mode: 'str' = 'combine', iterations: 'int' = 100, parallelism: 'int' = 1, shortest_path: 'bool' = False, require_capacity: 'bool' = True, flow_placement: 'FlowPlacement | str' = <FlowPlacement.PROPORTIONAL: 1>, baseline: 'bool' = False, seed: 'int | None' = None, store_failure_patterns: 'bool' = False, include_flow_summary: 'bool' = False, **kwargs) -> 'Any' ` - Analyze maximum flow capacity envelopes between node groups under failures.
2808- - ` run_monte_carlo_analysis(self, analysis_func: 'AnalysisFunction', iterations: 'int' = 1, parallelism: 'int' = 1, baseline: 'bool' = False, seed: 'int | None' = None, store_failure_patterns: 'bool' = False, **analysis_kwargs) -> 'dict[str, Any]' ` - Run Monte Carlo failure analysis with any analysis function.
2809- - ` run_sensitivity_monte_carlo(self, source: 'str | dict[str, Any]', sink: 'str | dict[str, Any]', mode: 'str' = 'combine', iterations: 'int' = 100, parallelism: 'int' = 1, shortest_path: 'bool' = False, flow_placement: 'FlowPlacement | str' = <FlowPlacement.PROPORTIONAL: 1>, baseline: 'bool' = False, seed: 'int | None' = None, store_failure_patterns: 'bool' = False, **kwargs) -> 'dict[str, Any]' ` - Analyze component criticality for flow capacity under failures.
2823+ - ` run_demand_placement_monte_carlo(self, demands_config: 'list[dict[str, Any]] | Any', iterations: 'int' = 100, parallelism: 'int' = 1, placement_rounds: 'int | str' = 'auto', seed: 'int | None' = None, store_failure_patterns: 'bool' = False, include_flow_details: 'bool' = False, include_used_edges: 'bool' = False, **kwargs) -> 'Any' ` - Analyze traffic demand placement success under failures.
2824+ - ` run_max_flow_monte_carlo(self, source: 'str | dict[str, Any]', sink: 'str | dict[str, Any]', mode: 'str' = 'combine', iterations: 'int' = 100, parallelism: 'int' = 1, shortest_path: 'bool' = False, require_capacity: 'bool' = True, flow_placement: 'FlowPlacement | str' = <FlowPlacement.PROPORTIONAL: 1>, seed: 'int | None' = None, store_failure_patterns: 'bool' = False, include_flow_summary: 'bool' = False, **kwargs) -> 'Any' ` - Analyze maximum flow capacity envelopes between node groups under failures.
2825+ - ` run_monte_carlo_analysis(self, analysis_func: 'AnalysisFunction', iterations: 'int' = 1, parallelism: 'int' = 1, seed: 'int | None' = None, store_failure_patterns: 'bool' = False, **analysis_kwargs) -> 'dict[str, Any]' ` - Run Monte Carlo failure analysis with any analysis function.
2826+ - ` run_sensitivity_monte_carlo(self, source: 'str | dict[str, Any]', sink: 'str | dict[str, Any]', mode: 'str' = 'combine', iterations: 'int' = 100, parallelism: 'int' = 1, shortest_path: 'bool' = False, flow_placement: 'FlowPlacement | str' = <FlowPlacement.PROPORTIONAL: 1>, seed: 'int | None' = None, store_failure_patterns: 'bool' = False, **kwargs) -> 'dict[str, Any]' ` - Analyze component criticality for flow capacity under failures.
28102827- ` run_single_failure_scenario(self, analysis_func: 'AnalysisFunction', **kwargs) -> 'Any' ` - Run a single failure scenario for convenience.
28112828
28122829---
0 commit comments