@@ -10,7 +10,7 @@ For a curated, example-driven API guide, see **[api.md](api.md)**.
1010> - ** [ CLI Reference] ( cli.md ) ** - Command-line interface
1111> - ** [ DSL Reference] ( dsl.md ) ** - YAML syntax guide
1212
13- ** Generated from source code on:** July 05 , 2025 at 23:05 UTC
13+ ** Generated from source code on:** July 06 , 2025 at 02:10 UTC
1414
1515** Modules auto-discovered:** 51
1616
@@ -892,35 +892,67 @@ CapacityEnvelope, TrafficMatrixSet, PlacementResultSet, and FailurePolicySet cla
892892
893893### CapacityEnvelope
894894
895- Range of max-flow values measured between two node groups .
895+ Frequency-based capacity envelope that stores capacity values as frequencies .
896896
897- This immutable dataclass stores capacity measurements and automatically
898- computes statistical measures in __ post_init __ .
897+ This approach is more memory-efficient for Monte Carlo analysis where we care
898+ about statistical distributions rather than individual sample order .
899899
900900Attributes:
901- source_pattern: Regex pattern for selecting source nodes.
902- sink_pattern: Regex pattern for selecting sink nodes.
903- mode: Flow computation mode (e.g., "combine").
904- capacity_values: List of measured capacity values.
905- min_capacity: Minimum capacity value (computed).
906- max_capacity: Maximum capacity value (computed).
907- mean_capacity: Mean capacity value (computed).
908- stdev_capacity: Standard deviation of capacity values (computed).
901+ source_pattern: Regex pattern used to select source nodes.
902+ sink_pattern: Regex pattern used to select sink nodes.
903+ mode: Flow analysis mode ("combine" or "pairwise").
904+ frequencies: Dictionary mapping capacity values to their occurrence counts.
905+ min_capacity: Minimum observed capacity.
906+ max_capacity: Maximum observed capacity.
907+ mean_capacity: Mean capacity across all samples.
908+ stdev_capacity: Standard deviation of capacity values.
909+ total_samples: Total number of samples represented.
909910
910911** Attributes:**
911912
912913- ` source_pattern ` (str)
913914- ` sink_pattern ` (str)
914- - ` mode ` (str) = combine
915- - ` capacity_values ` (list [ float] ) = [ ]
915+ - ` mode ` (str)
916+ - ` frequencies ` (Dict [ float, int ] )
916917- ` min_capacity ` (float)
917918- ` max_capacity ` (float)
918919- ` mean_capacity ` (float)
919920- ` stdev_capacity ` (float)
921+ - ` total_samples ` (int)
920922
921923** Methods:**
922924
923- - ` to_dict(self) -> 'dict[str, Any]' `
925+ - ` expand_to_values(self) -> 'List[float]' `
926+ - Expand frequency map back to individual values (for backward compatibility).
927+ - ` from_values(source_pattern: 'str', sink_pattern: 'str', mode: 'str', values: 'List[float]') -> "'CapacityEnvelope'" `
928+ - Create frequency-based envelope from a list of capacity values.
929+ - ` get_percentile(self, percentile: 'float') -> 'float' `
930+ - Calculate percentile from frequency distribution.
931+ - ` to_dict(self) -> 'Dict[str, Any]' `
932+ - Convert to dictionary for JSON serialization.
933+
934+ ### FailurePatternResult
935+
936+ Result for a unique failure pattern with associated capacity matrix.
937+
938+ Attributes:
939+ excluded_nodes: List of failed node IDs.
940+ excluded_links: List of failed link IDs.
941+ capacity_matrix: Dictionary mapping flow keys to capacity values.
942+ count: Number of times this pattern occurred.
943+ is_baseline: Whether this represents the baseline (no failures) case.
944+
945+ ** Attributes:**
946+
947+ - ` excluded_nodes ` (List[ str] )
948+ - ` excluded_links ` (List[ str] )
949+ - ` capacity_matrix ` (Dict[ str, float] )
950+ - ` count ` (int)
951+ - ` is_baseline ` (bool) = False
952+
953+ ** Methods:**
954+
955+ - ` to_dict(self) -> 'Dict[str, Any]' `
924956 - Convert to dictionary for JSON serialization.
925957
926958### FailurePolicySet
@@ -2199,6 +2231,8 @@ This implementation uses parallel processing for efficiency:
21992231- NetworkView provides lightweight exclusion without deep copying
22002232- Flow computations are cached within workers to avoid redundant calculations
22012233
2234+ All results are stored using frequency-based storage for memory efficiency.
2235+
22022236YAML Configuration:
22032237 ```yaml
22042238 workflow:
@@ -2214,11 +2248,13 @@ YAML Configuration:
22142248 flow_placement: "PROPORTIONAL" # Flow placement strategy
22152249 baseline: true # Optional: Run first iteration without failures
22162250 seed: 42 # Optional: Seed for reproducible results
2251+ store_failure_patterns: false # Optional: Store failure patterns in results
22172252 ```
22182253
22192254Results stored in scenario.results:
22202255 - ` capacity_envelopes ` : Dictionary mapping flow keys to CapacityEnvelope data
2221- - ` total_capacity_samples ` : List of total capacity values per iteration
2256+ - ` total_capacity_frequencies ` : Frequency map of total capacity values
2257+ - ` failure_pattern_results ` : Frequency map of failure patterns (if store_failure_patterns=True)
22222258
22232259Attributes:
22242260 source_path: Regex pattern to select source node groups.
@@ -2231,6 +2267,7 @@ Attributes:
22312267 flow_placement: Flow placement strategy (default: PROPORTIONAL).
22322268 baseline: If True, run first iteration without failures as baseline (default: False).
22332269 seed: Optional seed for deterministic results (for debugging).
2270+ store_failure_patterns: If True, store failure patterns in results (default: False).
22342271
22352272** Attributes:**
22362273
@@ -2245,6 +2282,7 @@ Attributes:
22452282- ` shortest_path ` (bool) = False
22462283- ` flow_placement ` (FlowPlacement) = 1
22472284- ` baseline ` (bool) = False
2285+ - ` store_failure_patterns ` (bool) = False
22482286
22492287** Methods:**
22502288
@@ -2605,7 +2643,7 @@ Analyzes capacity envelope data and creates matrices.
26052643- ` analyze_and_display_flow_availability(self, results: 'Dict[str, Any]', step_name: 'str') -> 'None' `
26062644 - Analyse flow availability and render summary statistics & plots.
26072645- ` analyze_flow_availability(self, results: 'Dict[str, Any]', **kwargs) -> 'Dict[str, Any]' `
2608- - Create CDF/availability distribution for * total_capacity_samples * .
2646+ - Create CDF/availability distribution for * total_capacity_frequencies * .
26092647- ` display_analysis(self, analysis: 'Dict[str, Any]', **kwargs) -> 'None' `
26102648 - Pretty-print * analysis* to the notebook/stdout.
26112649- ` get_description(self) -> 'str' `
0 commit comments