GC_Morton2000 module

class GC_Morton2000.Morton2000(grid, init_config, fitness_ratio=1, loss_factor=0.08, verbose_logging=30)[source]

Bases: object

Implementation of the Morton 2000 algorithm for optimizing network configurations.

net

The network object containing distribution network data.

candidates

A list to store candidate network configurations.

initial_loops

Initial loop configurations for the network.

init_config

Initial configuration of the network.

best_power_loss

Variable to track the best (minimum) power loss during optimization.

ChooseBestTree()[source]

Chooses the best tree configuration based on the lowest power loss.

This method tests each candidate configuration and tracks the configuration with the lowest power loss.

Returns:

The best tree configuration and the associated power flow results.

RemoveDuplicates(tot_candidates)[source]

Removes duplicate candidates from the list of total candidates.

This method populates the candidates list with unique configurations.

SearchTrees()[source]

Starts the search for trees in the network based on initial loops.

This method reconfigures the network, initializes candidates, and starts the recursive search for trees.

Solve(max_candidates=inf)[source]

Main method to solve the network optimization problem.

Parameters:

max_candidates – The maximum number of candidate configurations to consider.

Returns:

The best tree configuration and associated results.

__init__(grid, init_config, fitness_ratio=1, loss_factor=0.08, verbose_logging=30) None[source]

Initializes the Morton2000 class with required parameters.

Parameters:
  • net – The network object for optimization.

  • init_config – The initial configuration of the network.

  • verbose_logging – Logging level for debug messages.