Package Structure and Interactions#
Core Components#
DC Optimizer (dc/)#
worker/: Kafka-based worker infrastructure for distributed optimizationoptimizer.py: Core optimization logic and genetic algorithm executionworker.py: Kafka consumer/producer for distributed coordination
genetic_functions/: Evolutionary operators and fitness evaluationrepertoire/: Map-Elites repertoire management and visualization
AC Optimizer (ac/)#
worker.py: AC validation worker with database storageoptimizer.py: AC loadflow execution and strategy managementevolution_functions.py: Evolution operators (pull, reconnect, close_coupler)scoring_functions.py: AC power flow computation and metrics
Interfaces (interfaces/)#
- Message protocols: Kafka message definitions for inter-optimizer communication
- Parameters: Configuration classes for
DCandACoptimizer parameters - Results: Standardized topology and metrics data structures
Integration with Other Packages#
DC Solver Integration#
The topology optimizer leverages the DC Solver package for high-performance loadflow computation:
- PTDF/BSDF matrices: Pre-computed sensitivity matrices for rapid topology evaluation
- Batch processing: Simultaneous evaluation of multiple topologies and contingencies
- Injection bruteforcing: Efficient exploration of injection patterns
- Cross-coupler flows: Advanced switching modeling
Interfaces Package#
Uses the Interfaces package for standardized data structures:
Asset Topology: Physical substation and switching device modelsStored Action Set: Pre-computed topology actions and switching sequencesN-1 Definition: Contingency analysis specificationsLoadflow Results: Standardized power flow output formats
Grid Import Integration#
Works with the Importer package for data preprocessing:
- Static Information: Grid topology and electrical parameters
- Network Data: Processed grid models compatible with optimization algorithms
- Action enumeration: Systematic generation of feasible switching actions