agentlib_flexquant.optimization_backends package

Submodules

agentlib_flexquant.optimization_backends.constrained_cia module

pydantic model agentlib_flexquant.optimization_backends.constrained_cia.ConstrainedCIABackendConfig[source]

Bases: CasadiBackendConfig

Config:
  • extra: str = forbid

Fields:
Validators:

field full_controls_dict: dict = {}

Holds a key value pair for each full control of the Baseline

field market_time: int = 900

Time for market interaction

Constraints:
  • ge = 0

field use_rounding: bool = False

If True, CIA is skipped and plain rounding is used.

class Config[source]

Bases: object

extra = 'forbid'
class agentlib_flexquant.optimization_backends.constrained_cia.ConstrainedCasADiCIABackend(*args, **kwargs)[source]

Bases: CasADiCIABackend

config_type

alias of ConstrainedCIABackendConfig

do_pycombina(b_rel: array) array[source]
get_baseline_binary_solution(bin_con)[source]
solve(now: float, current_vars: dict[str, agentlib_mpc.data_structures.mpc_datamodels.MPCVariable]) Results[source]

Solves the optimization problem given the current values of the corresponding AgentVariables and system time. The standardization of return values is a work in progress.

Parameters:
  • now – Current time used for interpolation of input trajectories.

  • current_vars – Dict of AgentVariables holding the values relevant to the optimization problem. Keys are the names

Returns:

A dataframe with all optimization variables over their respective grids. Depending on discretization, can include many nan’s, so care should be taken when using this, e.g. always use dropna() after accessing a column.

Example:

variables mDot | T_0 | slack_T

time 0 0.1 | 298 | nan 230 nan | 297 | 3 470 nan | 296 | 2 588 nan | 295 | 1 700 0.05 | 294 | nan 930 nan | 294 | 0.1

var_ref: MINLPVariableReference