VeraGridEngine.Simulations.InvestmentsEvaluation package

Subpackages

Submodules

VeraGridEngine.Simulations.InvestmentsEvaluation.investments_evaluation_driver module

class VeraGridEngine.Simulations.InvestmentsEvaluation.investments_evaluation_driver.InvestmentsEvaluationDriver(grid: MultiCircuit, options: InvestmentsEvaluationOptions, problem: BlackBoxProblemTemplate, engine: EngineType = VeraGrid)[source]

Bases: DriverTemplate

cancel()[source]

Cancel the simulation

evaluate_individual_investments()[source]

Run a one-by-one investment evaluation without considering multiple evaluation groups at a time

get_steps()[source]
Returns:

independent_evaluation() None[source]

Evaluate projects with a CBA-like reference/PINT/TOOT ranking and then build a cumulative portfolio.

initialize(max_iter: int)[source]

Initialize the results :param max_iter: Maximum iterations

name = 'Investments evaluation'
objective_function(x: ndarray[tuple[Any, ...], dtype[int64]], record_results: bool = True) ndarray[tuple[Any, ...], dtype[float64]][source]

Function to evaluate a combination of investments :param x: vector of investments (yes/no). Length = number of investment groups :param record_results: record the results or not :return: multi-objective function criteria values

objective_function_so(x: ndarray[tuple[Any, ...], dtype[int64]]) float[source]

Single objective version of the objective function :param x: vector of investments (yes/no). Length = number of investment groups :return: summation of the objectives

optimized_evaluation_mixed_nsga2() None[source]

Run an optimized investment evaluation on mixed variables with NSGA2

optimized_evaluation_mvrsm_pareto() None[source]

Run an optimized investment evaluation without considering multiple evaluation groups at a time

optimized_evaluation_nsga3() None[source]

Run an optimized investment evaluation with NSGA3

optimized_evaluation_pint_toot_nsga3() None[source]

Run an NSGA3 search warm-started with the direct PINT and TOOT evaluations.

options
problem: BlackBoxProblemTemplate
randomized_evaluation() None[source]

Run purely random evaluations, without any optimization

run() None[source]

run the QThread

tpe = 'Investments evaluation'

VeraGridEngine.Simulations.InvestmentsEvaluation.investments_evaluation_options module

class VeraGridEngine.Simulations.InvestmentsEvaluation.investments_evaluation_options.InvestmentsEvaluationOptions(max_eval: int, pf_options: PowerFlowOptions | None = None, opf_options: OptimalPowerFlowOptions | None = None, solver: InvestmentEvaluationMethod = NSGA3, obj_tpe: InvestmentsEvaluationObjectives = PowerFlow, plugin_fcn_ptr: Callable = None)[source]

Bases: OptionsTemplate

Investments Evaluation Options

CLASS_NON_EDITABLE_PROPERTIES: Tuple[str, ...] = ('idtag', 'diff_changes')
CLASS_PROPERTIES_WITH_PROFILE: Dict[str, str] = {}
CLASS_PROPERTY_DECLARATIONS: Tuple[GCProp, ...] = (prop:idtag, prop:name, prop:code, prop:rdfid, prop:action, prop:comment, prop:diff_changes, prop:max_eval, prop:pf_options, prop:opf_options, prop:solver, prop:objf_tpe)
CLASS_PROPERTY_LIST: Tuple[GCProp, ...] = (prop:idtag, prop:name, prop:code, prop:rdfid, prop:action, prop:comment, prop:diff_changes, prop:max_eval, prop:pf_options, prop:opf_options, prop:solver, prop:objf_tpe)
CLASS_REGISTERED_PROPERTIES: Dict[str, GCProp] = {'action': prop:action, 'code': prop:code, 'comment': prop:comment, 'diff_changes': prop:diff_changes, 'idtag': prop:idtag, 'max_eval': prop:max_eval, 'name': prop:name, 'objf_tpe': prop:objf_tpe, 'opf_options': prop:opf_options, 'pf_options': prop:pf_options, 'rdfid': prop:rdfid, 'solver': prop:solver}
LOCAL_PROPERTY_DECLARATIONS: Tuple[GCProp, ...] = (prop:max_eval, prop:pf_options, prop:opf_options, prop:solver, prop:objf_tpe)
action: ActionType
comment: str
device_type: DeviceType
diff_changes
selected_to_merge

VeraGridEngine.Simulations.InvestmentsEvaluation.investments_evaluation_results module

class VeraGridEngine.Simulations.InvestmentsEvaluation.investments_evaluation_results.InvestmentsEvaluationResults(f_names: ndarray[tuple[Any, ...], dtype[str_]], x_names: ndarray[tuple[Any, ...], dtype[str_]], max_eval: int, plot_x_idx: int, plot_y_idx: int)[source]

Bases: ResultsTemplate

CLASS_DATA_VARIABLES = {'f': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'f_best': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'f_names': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'max_eval': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'plot_x_idx': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'plot_y_idx': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'sorting_indices': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'x': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'x_names': <VeraGridEngine.Simulations.results_template.ResultsProperty object>}
CLASS_RESULTS_DECLARATIONS = (<VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>)
LOCAL_RESULTS_DECLARATIONS = (<VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>)
add(x_vec: ndarray[tuple[Any, ...], dtype[float64]], f_vec: ndarray[tuple[Any, ...], dtype[float64]]) None[source]
Parameters:
  • x_vec

  • f_vec

Returns:

property current_evaluation: int
property f: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]]
property f_best: ndarray[tuple[Any, ...], dtype[int64]]
f_names: StrVec
finalize()[source]

Finalize the results after simulation

get_index() ndarray[tuple[Any, ...], dtype[str_]][source]
property max_eval: int
mdl(result_type) ResultsTable[source]

Plot the results :param result_type: type of results (string) :return: DataFrame of the results (or None if the result was not understood)

plot_x_idx
plot_y_idx
set_at(i: int, x_vec: ndarray[tuple[Any, ...], dtype[float64]], f_vec: ndarray[tuple[Any, ...], dtype[float64]])[source]
Parameters:
  • i

  • x_vec

  • f_vec

Returns:

set_best_combination(combination: ndarray[tuple[Any, ...], dtype[int64]]) None[source]

Set the best combination of investment groups :param combination: Vector of integers (0/1)

property sorting_indices: ndarray[tuple[Any, ...], dtype[int64]]
tpe = 'Investments Evaluation Results'
property x: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]]
x_names: StrVec

Module contents