VeraGridEngine.Simulations.InvestmentsEvaluation.Methods package

Submodules

VeraGridEngine.Simulations.InvestmentsEvaluation.Methods.NSGA_3 module

class VeraGridEngine.Simulations.InvestmentsEvaluation.Methods.NSGA_3.BitflipMutation[source]

Bases: Mutation

class VeraGridEngine.Simulations.InvestmentsEvaluation.Methods.NSGA_3.GridNsga(obj_func, n_var, n_obj, lb: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[Any, ...], dtype[int64]], ub: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[Any, ...], dtype[int64]])[source]

Bases: ElementwiseProblem

Problem formulation packaging to use the pymoo library

class VeraGridEngine.Simulations.InvestmentsEvaluation.Methods.NSGA_3.IntegerRandomSamplingVeraGrid[source]

Bases: Sampling

VeraGridEngine.Simulations.InvestmentsEvaluation.Methods.NSGA_3.NSGA_3(obj_func, n_var: int, lb: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[Any, ...], dtype[int64]], ub: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[Any, ...], dtype[int64]], n_obj: int, n_partitions: int = 100, max_evals: int = 30, pop_size: int = 1, crossover_prob: float = 0.05, mutation_probability=0.5, eta: float = 3.0, initial_population: ndarray[tuple[Any, ...], dtype[int64]] | None = None, initial_objectives: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]] | None = None)[source]

NSGA3 designed for pareto investments :param obj_func: Objective function pointer [f(x)] :param n_partitions: Number of partitions :param n_var: Number of variables :param lb: Array of x lower boundaries :param ub: Array of x upper boundaries :param n_obj: Number of objectives :param max_evals: Maximum number of evaluations :param pop_size: Population size :param crossover_prob: Crossover probability :param mutation_probability: Mutation probability :param eta: eta parameter for the SBX crossover :param initial_population: Optional integer population used to seed the first NSGA3 generation. :type initial_population: IntMat | None :param initial_objectives: Optional objective vectors aligned with initial_population. :type initial_objectives: Mat | None :return: X, f

class VeraGridEngine.Simulations.InvestmentsEvaluation.Methods.NSGA_3.QuadBinarySampling[source]

Bases: Sampling

class VeraGridEngine.Simulations.InvestmentsEvaluation.Methods.NSGA_3.SkewedBinarySampling[source]

Bases: Sampling

class VeraGridEngine.Simulations.InvestmentsEvaluation.Methods.NSGA_3.SkewedIntegerSamplingRange[source]

Bases: Sampling

SkewedIntegerSampling generates samples skewed toward the lower bounds but spread across the full lb–ub range. Works for integer variables.

class VeraGridEngine.Simulations.InvestmentsEvaluation.Methods.NSGA_3.UniformBinarySampling[source]

Bases: Sampling

VeraGridEngine.Simulations.InvestmentsEvaluation.Methods.NSGA_3.finalize_seed_population(seed_population: ndarray[tuple[Any, ...], dtype[int64]], seed_objectives: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]] | None, lb: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[Any, ...], dtype[int64]], ub: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[Any, ...], dtype[int64]]) tuple[ndarray[tuple[Any, ...], dtype[int64]], ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]] | None][source]

Clip, round and deduplicate a user-provided seed population.

Parameters:
  • seed_population (IntMat) – Candidate initial population.

  • seed_objectives (Mat | None) – Optional objective matrix aligned with seed_population.

  • lb (Vec | IntVec) – Lower decision-vector bounds.

  • ub (Vec | IntVec) – Upper decision-vector bounds.

Returns:

Clean seed population and aligned objective matrix.

Return type:

tuple[IntMat, Mat | None]

VeraGridEngine.Simulations.InvestmentsEvaluation.Methods.NSGA_3.get_nsga3_initial_population(problem: ElementwiseProblem, pop_size: int, initial_population: ndarray[tuple[Any, ...], dtype[int64]], initial_objectives: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]] | None) Population[source]

Build an optional pymoo initial population from plain NumPy arrays.

Parameters:
  • problem (ElementwiseProblem) – pymoo problem instance.

  • pop_size (int) – Requested NSGA3 population size.

  • initial_population (IntMat) – Seed decision vectors.

  • initial_objectives (Mat | None) – Optional objective vectors aligned with initial_population.

Returns:

pymoo population object with optional pre-evaluated individuals.

Return type:

Population

VeraGridEngine.Simulations.InvestmentsEvaluation.Methods.mixed_variable_NSGA_2 module

class VeraGridEngine.Simulations.InvestmentsEvaluation.Methods.mixed_variable_NSGA_2.MixedVariableProblem(grid: MultiCircuit, obj_func, n_obj)[source]

Bases: ElementwiseProblem

Problem formulation packaging to use the pymoo library

VeraGridEngine.Simulations.InvestmentsEvaluation.Methods.mixed_variable_NSGA_2.NSGA_2(grid: MultiCircuit, obj_func, n_obj: int = 2, max_evals: int = 30, pop_size: int = 1)[source]
Parameters:
  • obj_func

  • n_obj

  • max_evals

  • pop_size

# :param crossover_prob: # :param mutation_probability: # :param eta: :return:

VeraGridEngine.Simulations.InvestmentsEvaluation.Methods.random_eval module

VeraGridEngine.Simulations.InvestmentsEvaluation.Methods.random_eval.random_trial(obj_func, n_var: int, lb: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[Any, ...], dtype[int64]], ub: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[Any, ...], dtype[int64]], n_obj: int = 2, max_evals: int = 3000)[source]
Parameters:
  • obj_func

  • n_var

  • n_obj

  • max_evals

Returns:

VeraGridEngine.Simulations.InvestmentsEvaluation.Methods.stop_crits module

class VeraGridEngine.Simulations.InvestmentsEvaluation.Methods.stop_crits.MaxItersStopCriterion(iters)[source]

Bases: StopCriterion

add(x)[source]

Updates the criterion result based on a new observation. :param x: the observation

class VeraGridEngine.Simulations.InvestmentsEvaluation.Methods.stop_crits.StochStopCriterion(dist, p=0.95)[source]

Bases: StopCriterion

add(x)[source]

Updates the criterion result based on a new observation. :param x: the observation

class VeraGridEngine.Simulations.InvestmentsEvaluation.Methods.stop_crits.StopCriterion[source]

Bases: object

StopCriterion:

add(x)[source]

Updates the criterion result based on a new observation. :param x: the observation

Module contents