Model Configuration

A ModelConfiguration accumulates the decision variables, objectives, and constraints that define an optimisation problem.

ModelConfiguration

ModelConfiguration — the decision variables, objectives, and constraints of an optimisation problem, plus per-model solver flags.

class ModelConfiguration[source]

Decision variables, objectives, constraints, and solver-level flags for one model.

set_disable_seed_solution(disable_seed_solution)[source]

Disable the seed solution loaded from input data.

Return type:

ModelConfiguration

set_calculated_seed(calculated_seed)[source]

Enable computing the seed solution from formulas instead of input data.

Return type:

ModelConfiguration

set_validation_enabled(validation_enabled)[source]

Enable or disable validators on the input data.

Return type:

ModelConfiguration

set_profiling(profiling)[source]

Enable solver-side performance profiling.

Return type:

ModelConfiguration

set_hide_objective_when_infeasible(hide_objective_when_infeasible)[source]

Hide objective values from the UI when the solution is infeasible.

Return type:

ModelConfiguration

set_stochastic_configuration(stochastic_configuration)[source]

Attach a StochasticConfiguration for multi-trial evaluation.

Return type:

ModelConfiguration

set_external_configuration(custom_evaluator_version, custom_evaluator_key, external_configuration)[source]

Route evaluation through an external evaluator with the given version, key, and ExternalModelConfiguration mappings.

Return type:

ModelConfiguration

add_decision_variable(dv, dv_table=None, dv_type=DVType.RANGE)[source]

Register a decision variable.

Parameters:
  • dv (Parameter | Field) – A model Parameter (model-level DV) or a DataField (per-row DV).

  • dv_table (Table | None) – The DataTable for a per-row DV. None for a model-level DV.

  • dv_type (DVType) – DVType controlling the variable’s domain.

Return type:

DecisionVariable

Returns:

The new DecisionVariable; chain .set_min(...) and .set_max(...) to bound it.

add_objective(objective, maximise=False, priority=Priority.HIGH, weight=1.0, name=None)[source]

Register an Objective.

Parameters:
  • objective (Calculation | Parameter) – Numeric Calculation to optimise.

  • maximise (bool) – Direction of optimisation. Defaults to minimise.

  • priority (Priority) – Lexicographic Priority for multi-objective runs.

  • weight (float) – Objective weight when combining via a weighted comparator.

  • name (str | None) – Optional display name.

Return type:

Objective

add_constraint(constraint)[source]

Register a Constraint over a numeric calculation.

Returns the new Constraint; chain .set_type(...) and .set_lower_bound(...)/.set_upper_bound(...) to configure it.

Return type:

Constraint

add_scenario_output(name, scenario_output_value, scenario_output_table=None)[source]

Register a ScenarioOutput exposed in scenario comparison.

Raises:

ValueError – If name or the resolved cell reference duplicates an existing scenario output.

Return type:

ScenarioOutput