GC_Jakus2020 module
- class GC_Jakus2020.Jakus2020(grid=None, TieLines=None, PopulationSize=10, MutationProbability=0.02, ElitePopulation=4, Niter=10, fitness_ratio=1, loss_factor=2, verbose_logging=30)[source]
Bases:
objectImplements the Jakus 2020 algorithm for distribution network reconfiguration (DNR).
This class utilizes a genetic algorithms to optimize the distribution network reconfiguration by minimizing fitness (power losses/voltage drop) and ensuring radial connectivity.
- net
The distribution network instance.
- Type:
DistributionNetwork
- TieLines
List of Tie lines Lists. [previously was a single Tie Lines list for supplying Baran algorithm]
- Type:
- #discarted
PopulationSize_SBEA (int): Population size for the SBEA. #this parameter is not in use, ç the SBEA candidates will be generated externally and added in the TieLines parameter
- CalculateFitness(configuration)[source]
Calculates the fitness of a candidate configuration.
- Parameters:
candidate – List of selected configurations to evaluate.
- Returns:
A tuple containing the fitness value and a boolean indicating if the configuration is valid.
- InitialPopulationGeneration()[source]
Generates the initial population combining SBEA and Kruskal’s algorithm.
This method combines candidates generated from SBEA and Kruskal’s algorithms and sorts them based on their fitness values.
- MutationProcess(candidate)[source]
Processes mutation on a given candidate configuration.
If a mutation occurs, a random disabled line is activated and a new minimum spanning tree is generated based on the modified configuration.
- OffspringCrossOver(Parents)[source]
Performs crossover between parent candidates to generate offspring.
- ParentsSelection()[source]
Generates offspring candidates from the current population.
The method calculates the fitness for each candidate in the current population and selects parent pairs based on their fitness values.
- Returns:
A list of parent pairs for generating offspring.
- Return type:
- Solve()[source]
Solves the distribution network reconfiguration problem.
This method runs the genetic algorithm for a specified number of iterations, generating offspring and selecting the best candidates from the population.
- Returns:
The best candidate configuration found after the iterations.
- Return type:
- __init__(grid=None, TieLines=None, PopulationSize=10, MutationProbability=0.02, ElitePopulation=4, Niter=10, fitness_ratio=1, loss_factor=2, verbose_logging=30)[source]
Initializes the Jakus2020 class.
- Parameters:
net (DistributionNetwork) – The distribution network instance.
TieLines (list) – List of tie lines in the network.
PopulationSize (int) – Size of the population for the genetic algorithm.
MutationProbability (float) – Probability of mutation during the genetic process.
PopulationSize_SBEA (int) – Population size for the SBEA.
ElitePopulation (int) – Number of elite individuals to retain.
Niter (int) – Number of iterations for the genetic algorithm.
verbose_logging (int) – Logging level for verbose output.