class foxes_opt.core.FarmVarsProblem(foxes_opt.core.FarmOptProblem)[source]

Abstract base class for models that optimize farm variables.

Public members

initialize(pre_rotor_vars, post_rotor_vars, verbosity=1, **kwargs)[source]

Initialize the object.

abstract opt2farm_vars_individual(vars_int, vars_float)[source]

Translates optimization variables to farm variables

abstract opt2farm_vars_population(vars_int, vars_float, n_states)[source]

Translates optimization variables to farm variables

update_problem_individual(vars_int, vars_float)[source]

Update the algo and other data using the latest optimization variables.

update_problem_population(vars_int, vars_float)[source]

Update the algo and other data using the latest optimization variables.

FarmVarsProblem(name, algo, sel_turbines=None, ...)[source]

Constructor.

property farm

The wind farm

property sel_turbines

The selected turbines

property n_sel_turbines

The numer of selected turbines

property all_turbines

Flag for all turbines optimization

property counter

The current value of the application counter

classmethod tvar(var, turbine_i)[source]

Gets turbine variable name

classmethod parse_tvar(tvr)[source]

Parse foxes variable name and turbine index from turbine variable

apply_individual(vars_int, vars_float)[source]

Apply new variables to the problem.

apply_population(vars_int, vars_float)[source]

Apply new variables to the problem, for a whole population.

add_to_layout_figure(ax, **kwargs)[source]

Add to a layout figure

INT_INF = -999999
var_names_int()

The names of integer variables.

initial_values_int()

The initial values of the integer variables.

min_values_int()

The minimal values of the integer variables.

max_values_int()

The maximal values of the integer variables.

property n_vars_int

The number of int variables

var_names_float()

The names of float variables.

initial_values_float()

The initial values of the float variables.

min_values_float()

The minimal values of the float variables.

max_values_float()

The maximal values of the float variables.

property n_vars_float

The number of float variables

add_objective(objective, varmap_int=None, varmap_float=None, ...)

Add an objective to the problem.

add_constraint(constraint, varmap_int=None, varmap_float=None, ...)

Add a constraint to the problem.

property min_values_constraints

Gets the minimal values of constraints

property max_values_constraints

Gets the maximal values of constraints

property constraints_tol

Gets the tolerance values of constraints

property n_objectives

The total number of objectives, i.e., the sum of all components

property n_constraints

The total number of constraints, i.e., the sum of all components

calc_gradients(vars_int, vars_float, func, components, ivars, ...)

The actual gradient calculation, not to be called directly (call get_gradients instead).

get_gradients(vars_int, vars_float, func=None, components=None, ...)

Obtain gradients of a function that is linked to the problem.

property maximize_objs

Flags for objective maximization

evaluate_individual(vars_int, vars_float, ret_prob_res=False)

Evaluate a single individual of the problem.

evaluate_population(vars_int, vars_float, ret_prob_res=False)

Evaluate all individuals of a population.

check_constraints_individual(constraint_values, verbosity=0)

Check if the constraints are fullfilled for the given individual.

check_constraints_population(constraint_values, verbosity=0)

Check if the constraints are fullfilled for the given population.

finalize_individual(vars_int, vars_float, verbosity=1)

Finalization, given the champion data.

finalize_population(vars_int, vars_float, verbosity=0)

Finalization, given the final population data.

prob_res_einsum_individual(prob_res_list, coeffs)

Calculate the einsum of problem results

prob_res_einsum_population(prob_res_list, coeffs)

Calculate the einsum of problem results

__str__()

Get info string

property initialized

Flag for finished initialization

finalize(verbosity=0)

Finalize the object.