Skip to content

Package Structure and Interactions#

Core Components#

DC Optimizer (dc/)#

  • worker/: Kafka-based worker infrastructure for distributed optimization
    • optimizer.py: Core optimization logic and genetic algorithm execution
    • worker.py: Kafka consumer/producer for distributed coordination
  • genetic_functions/: Evolutionary operators and fitness evaluation
  • repertoire/: Map-Elites repertoire management and visualization

AC Optimizer (ac/)#

Interfaces (interfaces/)#

  • Message protocols: Kafka message definitions for inter-optimizer communication
  • Parameters: Configuration classes for DC and AC optimizer 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:

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