foxes_opt.problems.layout.geom_layouts.objectives

Classes

MaxDensity

Maximal turbine density objective

MaxGridSpacing

Maximal grid spacing objective

MeMiMaDist

Mean-min-max distance objective

OFixN

Fixed number of turbines objective

OMaxN

Maximal number of turbines objective

OMinN

Minimal number of turbines objective

Module Contents

class foxes_opt.problems.layout.geom_layouts.objectives.MaxDensity(problem: iwopy.Problem, dfactor: int = 1, min_dist: float | None = None, name: str = 'max_density')[source]

Bases: iwopy.Objective

Maximal turbine density objective for purely geometrical layouts problems.

Parameters:
problem

The underlying geometrical layout optimization problem

dfactor

Delta factor for grid spacing

min_dist

The minimal distance

name

The constraint name

ana_deriv(vars_int: numpy.ndarray, vars_float: numpy.ndarray, var: int, components: collections.abc.Sequence[int] | numpy.ndarray | None = None) → numpy.ndarray[source]

Calculate the analytical derivative for one float variable.

Parameters:
vars_int

The integer variable values

vars_float

The float variable values

var

The float variable index

components

The selected components, or None for all

Returns:
deriv

The derivative values, shape: (n_sel_components,)

calc_individual(vars_int: numpy.ndarray, vars_float: numpy.ndarray, problem_results: tuple[numpy.ndarray, numpy.ndarray], cmpnts: list[int] | None = None) → numpy.ndarray[source]

Calculate values for a single individual of the underlying problem.

Parameters:
vars_int

The integer variable values, shape: (n_vars_int,)

vars_float

The float variable values, shape: (n_vars_float,)

problem_results

The results of the variable application to the problem

components

The selected components or None for all

Returns:
values

The component values, shape: (n_sel_components,)

calc_population(vars_int: numpy.ndarray, vars_float: numpy.ndarray, problem_results: tuple[numpy.ndarray, numpy.ndarray], cmpnts: list[int] | None = None) → numpy.ndarray[source]

Calculate values for all individuals of a population.

Parameters:
vars_int

The integer variable values, shape: (n_pop, n_vars_int)

vars_float

The float variable values, shape: (n_pop, n_vars_float)

problem_results

The results of the variable application to the problem

components

The selected components or None for all

Returns:
values

The component values, shape: (n_pop, n_sel_components)

finalize(verbosity: int = 0, /) → None
finalize(*, verbosity: int = 0) → None

Finalize the object.

Parameters:
verbosity

The verbosity level, 0 = silent

finalize_individual(vars_int: numpy.ndarray, vars_float: numpy.ndarray, problem_results: object, verbosity: int = 1) → numpy.ndarray

Finalization, given the champion data.

Parameters:
vars_int

The optimal integer variable values, shape: (n_vars_int,)

vars_float

The optimal float variable values, shape: (n_vars_float,)

problem_results

The results of the variable application to the problem

verbosity

The verbosity level, 0 = silent

Returns:
values

The component values, shape: (n_components,)

finalize_population(vars_int: numpy.ndarray, vars_float: numpy.ndarray, problem_results: object, verbosity: int = 1) → numpy.ndarray

Finalization, given the final population data.

Parameters:
vars_int

The integer variable values of the final generation, shape: (n_pop, n_vars_int)

vars_float

The float variable values of the final generation, shape: (n_pop, n_vars_float)

problem_results

The results of the variable application to the problem

verbosity

The verbosity level, 0 = silent

Returns:
values

The component values, shape: (n_pop, n_components)

initialize(verbosity: int) → None[source]

Initialize the object.

Parameters:
verbosity

The verbosity level, 0 = silent

maximize() → list[bool][source]

Returns flag for maximization of each component.

Returns:
flags

Bool array for component maximization, shape

n_components() → int[source]

Returns the number of components of the function.

Returns:
value

The number of components.

classmethod new(objective_type: str, *args: object, **kwargs: object) → Objective

Run-time objective function factory.

Parameters:
objective_type

The selected derived class name

args

Additional parameters for constructor

kwargs

Additional parameters for constructor

rename_vars_float(varmap: collections.abc.Mapping[str | int, str]) → None

Rename float variables.

Parameters:
varmap

The name mapping. Key: old name str, Value: new name str

rename_vars_int(varmap: collections.abc.Mapping[str | int, str]) → None

Rename integer variables.

Parameters:
varmap

The name mapping. Key: old name str, Value: new name str

vardeps_float() → numpy.ndarray

Gets the dependencies of all components on the function float variables

Returns:
deps

The dependencies of components on function variables, shape: (n_components, n_vars_float)

vardeps_int() → numpy.ndarray

Gets the dependencies of all components on the function int variables

Returns:
deps

The dependencies of components on function variables, shape: (n_components, n_vars_int)

property component_names : list[str]

The names of the components

Returns:
names

The component names

dfactor : int = 1
property initialized : bool

Flag for finished initialization

Returns:
initialized

True if initialization has been done

min_dist
property n_vars_float : int

The number of float variables

Returns:
n

The number of float variables

property n_vars_int : int

The number of int variables

Returns:
n

The number of int variables

name = 'Base'
problem
property var_names_float : list[str]

The names of the float variables

Returns:
names

The float variable names

property var_names_int : list[str]

The names of the integer variables

Returns:
names

The integer variable names

class foxes_opt.problems.layout.geom_layouts.objectives.MaxGridSpacing(problem: iwopy.Problem, name: str = 'max_dxdy')[source]

Bases: iwopy.Objective

Maximal grid spacing objective for purely geometrical layouts problems.

Parameters:
problem

The underlying geometrical layout optimization problem

name

The constraint name

ana_deriv(vars_int: numpy.ndarray, vars_float: numpy.ndarray, var: int, components: collections.abc.Sequence[int] | numpy.ndarray | None = None) → numpy.ndarray[source]

Calculate the analytical derivative for one float variable.

Parameters:
vars_int

The integer variable values

vars_float

The float variable values

var

The float variable index

components

The selected components, or None for all

Returns:
deriv

The derivative values, shape: (n_sel_components,)

calc_individual(vars_int: numpy.ndarray, vars_float: numpy.ndarray, problem_results: tuple[numpy.ndarray, numpy.ndarray], cmpnts: list[int] | None = None) → numpy.ndarray[source]

Calculate values for a single individual of the underlying problem.

Parameters:
vars_int

The integer variable values, shape: (n_vars_int,)

vars_float

The float variable values, shape: (n_vars_float,)

problem_results

The results of the variable application to the problem

components

The selected components or None for all

Returns:
values

The component values, shape: (n_sel_components,)

calc_population(vars_int: numpy.ndarray, vars_float: numpy.ndarray, problem_results: tuple[numpy.ndarray, numpy.ndarray], cmpnts: list[int] | None = None) → numpy.ndarray[source]

Calculate values for all individuals of a population.

Parameters:
vars_int

The integer variable values, shape: (n_pop, n_vars_int)

vars_float

The float variable values, shape: (n_pop, n_vars_float)

problem_results

The results of the variable application to the problem

components

The selected components or None for all

Returns:
values

The component values, shape: (n_pop, n_sel_components)

finalize(verbosity: int = 0, /) → None
finalize(*, verbosity: int = 0) → None

Finalize the object.

Parameters:
verbosity

The verbosity level, 0 = silent

finalize_individual(vars_int: numpy.ndarray, vars_float: numpy.ndarray, problem_results: object, verbosity: int = 1) → numpy.ndarray

Finalization, given the champion data.

Parameters:
vars_int

The optimal integer variable values, shape: (n_vars_int,)

vars_float

The optimal float variable values, shape: (n_vars_float,)

problem_results

The results of the variable application to the problem

verbosity

The verbosity level, 0 = silent

Returns:
values

The component values, shape: (n_components,)

finalize_population(vars_int: numpy.ndarray, vars_float: numpy.ndarray, problem_results: object, verbosity: int = 1) → numpy.ndarray

Finalization, given the final population data.

Parameters:
vars_int

The integer variable values of the final generation, shape: (n_pop, n_vars_int)

vars_float

The float variable values of the final generation, shape: (n_pop, n_vars_float)

problem_results

The results of the variable application to the problem

verbosity

The verbosity level, 0 = silent

Returns:
values

The component values, shape: (n_pop, n_components)

initialize(verbosity: int = 0) → None

Initialize the object.

Parameters:
verbosity

The verbosity level, 0 = silent

maximize() → list[bool][source]

Returns flag for maximization of each component.

Returns:
flags

Bool array for component maximization, shape

n_components() → int[source]

Returns the number of components of the function.

Returns:
value

The number of components.

classmethod new(objective_type: str, *args: object, **kwargs: object) → Objective

Run-time objective function factory.

Parameters:
objective_type

The selected derived class name

args

Additional parameters for constructor

kwargs

Additional parameters for constructor

rename_vars_float(varmap: collections.abc.Mapping[str | int, str]) → None

Rename float variables.

Parameters:
varmap

The name mapping. Key: old name str, Value: new name str

rename_vars_int(varmap: collections.abc.Mapping[str | int, str]) → None

Rename integer variables.

Parameters:
varmap

The name mapping. Key: old name str, Value: new name str

vardeps_float() → numpy.ndarray

Gets the dependencies of all components on the function float variables

Returns:
deps

The dependencies of components on function variables, shape: (n_components, n_vars_float)

vardeps_int() → numpy.ndarray

Gets the dependencies of all components on the function int variables

Returns:
deps

The dependencies of components on function variables, shape: (n_components, n_vars_int)

property component_names : list[str]

The names of the components

Returns:
names

The component names

property initialized : bool

Flag for finished initialization

Returns:
initialized

True if initialization has been done

property n_vars_float : int

The number of float variables

Returns:
n

The number of float variables

property n_vars_int : int

The number of int variables

Returns:
n

The number of int variables

name = 'Base'
problem
property var_names_float : list[str]

The names of the float variables

Returns:
names

The float variable names

property var_names_int : list[str]

The names of the integer variables

Returns:
names

The integer variable names

class foxes_opt.problems.layout.geom_layouts.objectives.MeMiMaDist(problem: iwopy.Problem, scale: float = 500.0, c1: int = 1, c2: int = 1, c3: int = 1, name: str = 'MiMaMean')[source]

Bases: iwopy.Objective

Mean-min-max distance objective for purely geometrical layouts problems.

Parameters:
problem

The underlying geometrical layout optimization problem

scale

The distance scale

c1

Parameter for mean weighting

c2

Parameter for max diff weighting

c3

Parameter for min diff weighting

name

The constraint name

ana_deriv(vars_int: numpy.ndarray, vars_float: numpy.ndarray, var: int, components: collections.abc.Sequence[int] | numpy.ndarray | None = None) → numpy.ndarray[source]

Calculate the analytical derivative for one float variable.

Parameters:
vars_int

The integer variable values

vars_float

The float variable values

var

The float variable index

components

The selected components, or None for all

Returns:
deriv

The derivative values, shape: (n_sel_components,)

calc_individual(vars_int: numpy.ndarray, vars_float: numpy.ndarray, problem_results: tuple[numpy.ndarray, numpy.ndarray], cmpnts: list[int] | None = None) → numpy.ndarray[source]

Calculate values for a single individual of the underlying problem.

Parameters:
vars_int

The integer variable values, shape: (n_vars_int,)

vars_float

The float variable values, shape: (n_vars_float,)

problem_results

The results of the variable application to the problem

components

The selected components or None for all

Returns:
values

The component values, shape: (n_sel_components,)

calc_population(vars_int: numpy.ndarray, vars_float: numpy.ndarray, problem_results: tuple[numpy.ndarray, numpy.ndarray], cmpnts: list[int] | None = None) → numpy.ndarray[source]

Calculate values for all individuals of a population.

Parameters:
vars_int

The integer variable values, shape: (n_pop, n_vars_int)

vars_float

The float variable values, shape: (n_pop, n_vars_float)

problem_results

The results of the variable application to the problem

components

The selected components or None for all

Returns:
values

The component values, shape: (n_pop, n_sel_components)

finalize(verbosity: int = 0, /) → None
finalize(*, verbosity: int = 0) → None

Finalize the object.

Parameters:
verbosity

The verbosity level, 0 = silent

finalize_individual(vars_int: numpy.ndarray, vars_float: numpy.ndarray, problem_results: object, verbosity: int = 1) → numpy.ndarray

Finalization, given the champion data.

Parameters:
vars_int

The optimal integer variable values, shape: (n_vars_int,)

vars_float

The optimal float variable values, shape: (n_vars_float,)

problem_results

The results of the variable application to the problem

verbosity

The verbosity level, 0 = silent

Returns:
values

The component values, shape: (n_components,)

finalize_population(vars_int: numpy.ndarray, vars_float: numpy.ndarray, problem_results: object, verbosity: int = 1) → numpy.ndarray

Finalization, given the final population data.

Parameters:
vars_int

The integer variable values of the final generation, shape: (n_pop, n_vars_int)

vars_float

The float variable values of the final generation, shape: (n_pop, n_vars_float)

problem_results

The results of the variable application to the problem

verbosity

The verbosity level, 0 = silent

Returns:
values

The component values, shape: (n_pop, n_components)

initialize(verbosity: int = 0) → None

Initialize the object.

Parameters:
verbosity

The verbosity level, 0 = silent

maximize() → list[bool][source]

Returns flag for maximization of each component.

Returns:
flags

Bool array for component maximization, shape

n_components() → int[source]

Returns the number of components of the function.

Returns:
value

The number of components.

classmethod new(objective_type: str, *args: object, **kwargs: object) → Objective

Run-time objective function factory.

Parameters:
objective_type

The selected derived class name

args

Additional parameters for constructor

kwargs

Additional parameters for constructor

rename_vars_float(varmap: collections.abc.Mapping[str | int, str]) → None

Rename float variables.

Parameters:
varmap

The name mapping. Key: old name str, Value: new name str

rename_vars_int(varmap: collections.abc.Mapping[str | int, str]) → None

Rename integer variables.

Parameters:
varmap

The name mapping. Key: old name str, Value: new name str

vardeps_float() → numpy.ndarray

Gets the dependencies of all components on the function float variables

Returns:
deps

The dependencies of components on function variables, shape: (n_components, n_vars_float)

vardeps_int() → numpy.ndarray

Gets the dependencies of all components on the function int variables

Returns:
deps

The dependencies of components on function variables, shape: (n_components, n_vars_int)

c1 : int = 1
c2 : int = 1
c3 : int = 1
property component_names : list[str]

The names of the components

Returns:
names

The component names

property initialized : bool

Flag for finished initialization

Returns:
initialized

True if initialization has been done

property n_vars_float : int

The number of float variables

Returns:
n

The number of float variables

property n_vars_int : int

The number of int variables

Returns:
n

The number of int variables

name = 'Base'
problem
scale : float = 500.0
property var_names_float : list[str]

The names of the float variables

Returns:
names

The float variable names

property var_names_int : list[str]

The names of the integer variables

Returns:
names

The integer variable names

class foxes_opt.problems.layout.geom_layouts.objectives.OFixN(problem: iwopy.Problem, N: int, name: str = 'ofixN')[source]

Bases: foxes_opt.core.zero_derivatives.ZeroFloatDerivatives, iwopy.Objective

Fixed number of turbines objective for purely geometrical layouts problems.

Parameters:
problem

The underlying geometrical layout optimization problem

N

The number of turbines

name

The constraint name

ana_deriv(vars_int: numpy.ndarray, vars_float: numpy.ndarray, var: int, components: collections.abc.Sequence[int] | numpy.ndarray | None = None) → numpy.ndarray

Calculate the analytical derivative for one float variable.

Parameters:
vars_int

The integer variable values

vars_float

The float variable values

var

The float variable index

components

The selected components, or None for all

Returns:
deriv

The derivative values, shape: (n_sel_components,)

calc_individual(vars_int: numpy.ndarray, vars_float: numpy.ndarray, problem_results: tuple[numpy.ndarray, numpy.ndarray], cmpnts: list[int] | None = None) → numpy.ndarray[source]

Calculate values for a single individual of the underlying problem.

Parameters:
vars_int

The integer variable values, shape: (n_vars_int,)

vars_float

The float variable values, shape: (n_vars_float,)

problem_results

The results of the variable application to the problem

components

The selected components or None for all

Returns:
values

The component values, shape: (n_sel_components,)

calc_population(vars_int: numpy.ndarray, vars_float: numpy.ndarray, problem_results: tuple[numpy.ndarray, numpy.ndarray], cmpnts: list[int] | None = None) → numpy.ndarray[source]

Calculate values for all individuals of a population.

Parameters:
vars_int

The integer variable values, shape: (n_pop, n_vars_int)

vars_float

The float variable values, shape: (n_pop, n_vars_float)

problem_results

The results of the variable application to the problem

components

The selected components or None for all

Returns:
values

The component values, shape: (n_pop, n_sel_components)

finalize(verbosity: int = 0, /) → None
finalize(*, verbosity: int = 0) → None

Finalize the object.

Parameters:
verbosity

The verbosity level, 0 = silent

finalize_individual(vars_int: numpy.ndarray, vars_float: numpy.ndarray, problem_results: object, verbosity: int = 1) → numpy.ndarray

Finalization, given the champion data.

Parameters:
vars_int

The optimal integer variable values, shape: (n_vars_int,)

vars_float

The optimal float variable values, shape: (n_vars_float,)

problem_results

The results of the variable application to the problem

verbosity

The verbosity level, 0 = silent

Returns:
values

The component values, shape: (n_components,)

finalize_population(vars_int: numpy.ndarray, vars_float: numpy.ndarray, problem_results: object, verbosity: int = 1) → numpy.ndarray

Finalization, given the final population data.

Parameters:
vars_int

The integer variable values of the final generation, shape: (n_pop, n_vars_int)

vars_float

The float variable values of the final generation, shape: (n_pop, n_vars_float)

problem_results

The results of the variable application to the problem

verbosity

The verbosity level, 0 = silent

Returns:
values

The component values, shape: (n_pop, n_components)

initialize(verbosity: int = 0) → None

Initialize the object.

Parameters:
verbosity

The verbosity level, 0 = silent

maximize() → list[bool][source]

Returns flag for maximization of each component.

Returns:
flags

Bool array for component maximization, shape

n_components() → int[source]

Returns the number of components of the function.

Returns:
value

The number of components.

classmethod new(objective_type: str, *args: object, **kwargs: object) → Objective

Run-time objective function factory.

Parameters:
objective_type

The selected derived class name

args

Additional parameters for constructor

kwargs

Additional parameters for constructor

rename_vars_float(varmap: collections.abc.Mapping[str | int, str]) → None

Rename float variables.

Parameters:
varmap

The name mapping. Key: old name str, Value: new name str

rename_vars_int(varmap: collections.abc.Mapping[str | int, str]) → None

Rename integer variables.

Parameters:
varmap

The name mapping. Key: old name str, Value: new name str

vardeps_float() → numpy.ndarray

Gets the dependencies of all components on the function float variables

Returns:
deps

The dependencies of components on function variables, shape: (n_components, n_vars_float)

vardeps_int() → numpy.ndarray

Gets the dependencies of all components on the function int variables

Returns:
deps

The dependencies of components on function variables, shape: (n_components, n_vars_int)

N
property component_names : list[str]

The names of the components

Returns:
names

The component names

property initialized : bool

Flag for finished initialization

Returns:
initialized

True if initialization has been done

property n_vars_float : int

The number of float variables

Returns:
n

The number of float variables

property n_vars_int : int

The number of int variables

Returns:
n

The number of int variables

name = 'Base'
problem
property var_names_float : list[str]

The names of the float variables

Returns:
names

The float variable names

property var_names_int : list[str]

The names of the integer variables

Returns:
names

The integer variable names

class foxes_opt.problems.layout.geom_layouts.objectives.OMaxN(problem: iwopy.Problem, name: str = 'maxN')[source]

Bases: foxes_opt.core.zero_derivatives.ZeroFloatDerivatives, iwopy.Objective

Maximal number of turbines objective for purely geometrical layouts problems.

Parameters:
problem

The underlying geometrical layout optimization problem

name

The constraint name

ana_deriv(vars_int: numpy.ndarray, vars_float: numpy.ndarray, var: int, components: collections.abc.Sequence[int] | numpy.ndarray | None = None) → numpy.ndarray

Calculate the analytical derivative for one float variable.

Parameters:
vars_int

The integer variable values

vars_float

The float variable values

var

The float variable index

components

The selected components, or None for all

Returns:
deriv

The derivative values, shape: (n_sel_components,)

calc_individual(vars_int: numpy.ndarray, vars_float: numpy.ndarray, problem_results: tuple[numpy.ndarray, numpy.ndarray], cmpnts: list[int] | None = None) → numpy.ndarray[source]

Calculate values for a single individual of the underlying problem.

Parameters:
vars_int

The integer variable values, shape: (n_vars_int,)

vars_float

The float variable values, shape: (n_vars_float,)

problem_results

The results of the variable application to the problem

components

The selected components or None for all

Returns:
values

The component values, shape: (n_sel_components,)

calc_population(vars_int: numpy.ndarray, vars_float: numpy.ndarray, problem_results: tuple[numpy.ndarray, numpy.ndarray], cmpnts: list[int] | None = None) → numpy.ndarray[source]

Calculate values for all individuals of a population.

Parameters:
vars_int

The integer variable values, shape: (n_pop, n_vars_int)

vars_float

The float variable values, shape: (n_pop, n_vars_float)

problem_results

The results of the variable application to the problem

components

The selected components or None for all

Returns:
values

The component values, shape: (n_pop, n_sel_components)

finalize(verbosity: int = 0, /) → None
finalize(*, verbosity: int = 0) → None

Finalize the object.

Parameters:
verbosity

The verbosity level, 0 = silent

finalize_individual(vars_int: numpy.ndarray, vars_float: numpy.ndarray, problem_results: object, verbosity: int = 1) → numpy.ndarray

Finalization, given the champion data.

Parameters:
vars_int

The optimal integer variable values, shape: (n_vars_int,)

vars_float

The optimal float variable values, shape: (n_vars_float,)

problem_results

The results of the variable application to the problem

verbosity

The verbosity level, 0 = silent

Returns:
values

The component values, shape: (n_components,)

finalize_population(vars_int: numpy.ndarray, vars_float: numpy.ndarray, problem_results: object, verbosity: int = 1) → numpy.ndarray

Finalization, given the final population data.

Parameters:
vars_int

The integer variable values of the final generation, shape: (n_pop, n_vars_int)

vars_float

The float variable values of the final generation, shape: (n_pop, n_vars_float)

problem_results

The results of the variable application to the problem

verbosity

The verbosity level, 0 = silent

Returns:
values

The component values, shape: (n_pop, n_components)

initialize(verbosity: int = 0) → None

Initialize the object.

Parameters:
verbosity

The verbosity level, 0 = silent

maximize() → list[bool][source]

Returns flag for maximization of each component.

Returns:
flags

Bool array for component maximization, shape

n_components() → int[source]

Returns the number of components of the function.

Returns:
value

The number of components.

classmethod new(objective_type: str, *args: object, **kwargs: object) → Objective

Run-time objective function factory.

Parameters:
objective_type

The selected derived class name

args

Additional parameters for constructor

kwargs

Additional parameters for constructor

rename_vars_float(varmap: collections.abc.Mapping[str | int, str]) → None

Rename float variables.

Parameters:
varmap

The name mapping. Key: old name str, Value: new name str

rename_vars_int(varmap: collections.abc.Mapping[str | int, str]) → None

Rename integer variables.

Parameters:
varmap

The name mapping. Key: old name str, Value: new name str

vardeps_float() → numpy.ndarray

Gets the dependencies of all components on the function float variables

Returns:
deps

The dependencies of components on function variables, shape: (n_components, n_vars_float)

vardeps_int() → numpy.ndarray

Gets the dependencies of all components on the function int variables

Returns:
deps

The dependencies of components on function variables, shape: (n_components, n_vars_int)

property component_names : list[str]

The names of the components

Returns:
names

The component names

property initialized : bool

Flag for finished initialization

Returns:
initialized

True if initialization has been done

property n_vars_float : int

The number of float variables

Returns:
n

The number of float variables

property n_vars_int : int

The number of int variables

Returns:
n

The number of int variables

name = 'Base'
problem
property var_names_float : list[str]

The names of the float variables

Returns:
names

The float variable names

property var_names_int : list[str]

The names of the integer variables

Returns:
names

The integer variable names

class foxes_opt.problems.layout.geom_layouts.objectives.OMinN(problem: iwopy.Problem, name: str = 'ominN')[source]

Bases: OMaxN

Minimal number of turbines objective for purely geometrical layouts problems.

Parameters:
problem

The underlying geometrical layout optimization problem

name

The constraint name

ana_deriv(vars_int: numpy.ndarray, vars_float: numpy.ndarray, var: int, components: collections.abc.Sequence[int] | numpy.ndarray | None = None) → numpy.ndarray

Calculate the analytical derivative for one float variable.

Parameters:
vars_int

The integer variable values

vars_float

The float variable values

var

The float variable index

components

The selected components, or None for all

Returns:
deriv

The derivative values, shape: (n_sel_components,)

calc_individual(vars_int: numpy.ndarray, vars_float: numpy.ndarray, problem_results: tuple[numpy.ndarray, numpy.ndarray], cmpnts: list[int] | None = None) → numpy.ndarray

Calculate values for a single individual of the underlying problem.

Parameters:
vars_int

The integer variable values, shape: (n_vars_int,)

vars_float

The float variable values, shape: (n_vars_float,)

problem_results

The results of the variable application to the problem

components

The selected components or None for all

Returns:
values

The component values, shape: (n_sel_components,)

calc_population(vars_int: numpy.ndarray, vars_float: numpy.ndarray, problem_results: tuple[numpy.ndarray, numpy.ndarray], cmpnts: list[int] | None = None) → numpy.ndarray

Calculate values for all individuals of a population.

Parameters:
vars_int

The integer variable values, shape: (n_pop, n_vars_int)

vars_float

The float variable values, shape: (n_pop, n_vars_float)

problem_results

The results of the variable application to the problem

components

The selected components or None for all

Returns:
values

The component values, shape: (n_pop, n_sel_components)

finalize(verbosity: int = 0, /) → None
finalize(*, verbosity: int = 0) → None

Finalize the object.

Parameters:
verbosity

The verbosity level, 0 = silent

finalize_individual(vars_int: numpy.ndarray, vars_float: numpy.ndarray, problem_results: object, verbosity: int = 1) → numpy.ndarray

Finalization, given the champion data.

Parameters:
vars_int

The optimal integer variable values, shape: (n_vars_int,)

vars_float

The optimal float variable values, shape: (n_vars_float,)

problem_results

The results of the variable application to the problem

verbosity

The verbosity level, 0 = silent

Returns:
values

The component values, shape: (n_components,)

finalize_population(vars_int: numpy.ndarray, vars_float: numpy.ndarray, problem_results: object, verbosity: int = 1) → numpy.ndarray

Finalization, given the final population data.

Parameters:
vars_int

The integer variable values of the final generation, shape: (n_pop, n_vars_int)

vars_float

The float variable values of the final generation, shape: (n_pop, n_vars_float)

problem_results

The results of the variable application to the problem

verbosity

The verbosity level, 0 = silent

Returns:
values

The component values, shape: (n_pop, n_components)

initialize(verbosity: int = 0) → None

Initialize the object.

Parameters:
verbosity

The verbosity level, 0 = silent

maximize() → list[bool][source]

Returns flag for maximization of each component.

Returns:
flags

Bool array for component maximization, shape

n_components() → int

Returns the number of components of the function.

Returns:
value

The number of components.

classmethod new(objective_type: str, *args: object, **kwargs: object) → Objective

Run-time objective function factory.

Parameters:
objective_type

The selected derived class name

args

Additional parameters for constructor

kwargs

Additional parameters for constructor

rename_vars_float(varmap: collections.abc.Mapping[str | int, str]) → None

Rename float variables.

Parameters:
varmap

The name mapping. Key: old name str, Value: new name str

rename_vars_int(varmap: collections.abc.Mapping[str | int, str]) → None

Rename integer variables.

Parameters:
varmap

The name mapping. Key: old name str, Value: new name str

vardeps_float() → numpy.ndarray

Gets the dependencies of all components on the function float variables

Returns:
deps

The dependencies of components on function variables, shape: (n_components, n_vars_float)

vardeps_int() → numpy.ndarray

Gets the dependencies of all components on the function int variables

Returns:
deps

The dependencies of components on function variables, shape: (n_components, n_vars_int)

property component_names : list[str]

The names of the components

Returns:
names

The component names

property initialized : bool

Flag for finished initialization

Returns:
initialized

True if initialization has been done

property n_vars_float : int

The number of float variables

Returns:
n

The number of float variables

property n_vars_int : int

The number of int variables

Returns:
n

The number of int variables

name = 'Base'
problem
property var_names_float : list[str]

The names of the float variables

Returns:
names

The float variable names

property var_names_int : list[str]

The names of the integer variables

Returns:
names

The integer variable names