Variable

class desdeo_problem.problem.Variable(name, initial_value, lower_bound=-inf, upper_bound=inf)[source]

Bases: object

Simple variable with a name, initial value and bounds.

Parameters:
  • name (str) – Name of the variable

  • initial_value (float) – The initial value of the variable.

  • lower_bound (float, optional) – Lower bound of the variable. Defaults to negative infinity.

  • upper_bound (float, optional) – Upper bound of the variable. Defaults to positive infinity.

name

Name of the variable.

Type:

str

initial_value

Initial value of the variable.

Type:

float

lower_bound

Lower bound of the variable.

Type:

float

upper_bound

Upper bound of the variable.

Type:

float

current_value

The current value the variable holds.

Type:

float

Raises:

VariableError – Bounds are incorrect.

Attributes Summary

current_value

current_value

initial_value

initial_value

name

name

Methods Summary

get_bounds()

Return the bounds of the variables as a tuple.

Attributes Documentation

current_value

current_value

Returns:

The current value of the variable

Return type:

float

Type:

Property

initial_value

initial_value

Returns:

The initial value of the variable.

Return type:

float

Type:

Property

name

name

Returns:

The name of the variable.

Return type:

str

Type:

Property

Methods Documentation

get_bounds()[source]

Return the bounds of the variables as a tuple.

Returns:

A tuple consisting of (lower_bound,

upper_bound)

Return type:

tuple(float, float)