MAiNGOSolutionLoader
(class from pyomo.contrib.appsi.solvers.maingo
)
-
class pyomo.contrib.appsi.solvers.maingo.MAiNGOSolutionLoader(solver: PersistentSolver)[source]
Bases: PersistentSolutionLoader
-
__init__(solver: PersistentSolver)
Methods
__init__ (solver)
|
|
get_duals ([cons_to_load])
|
Returns a dictionary mapping constraint to dual value. |
get_primals ([vars_to_load])
|
Returns a ComponentMap mapping variable to var value. |
get_reduced_costs ([vars_to_load])
|
Returns a ComponentMap mapping variable to reduced cost. |
get_slacks ([cons_to_load])
|
Returns a dictionary mapping constraint to slack. |
invalidate ()
|
|
load_vars ([vars_to_load])
|
Load the solution of the primal variables into the value attribute of the variables. |
Member Documentation
-
get_duals(cons_to_load: Sequence[ConstraintData] | None = None) → Dict[ConstraintData, float]
Returns a dictionary mapping constraint to dual value.
- Parameters:
cons_to_load (list) – A list of the constraints whose duals should be retrieved. If cons_to_load is None, then the duals for all
constraints will be retrieved.
- Returns:
duals – Maps constraints to dual values
- Return type:
dict
-
get_primals(vars_to_load=None)[source]
Returns a ComponentMap mapping variable to var value.
- Parameters:
vars_to_load (list) – A list of the variables whose solution value should be retrieved. If vars_to_load is None,
then the values for all variables will be retrieved.
- Returns:
primals – Maps variables to solution values
- Return type:
ComponentMap
-
get_reduced_costs(vars_to_load: Sequence[VarData] | None = None) → Mapping[VarData, float]
Returns a ComponentMap mapping variable to reduced cost.
- Parameters:
vars_to_load (list) – A list of the variables whose reduced cost should be retrieved. If vars_to_load is None, then the
reduced costs for all variables will be loaded.
- Returns:
reduced_costs – Maps variables to reduced costs
- Return type:
ComponentMap
-
get_slacks(cons_to_load: Sequence[ConstraintData] | None = None) → Dict[ConstraintData, float]
Returns a dictionary mapping constraint to slack.
- Parameters:
cons_to_load (list) – A list of the constraints whose duals should be loaded. If cons_to_load is None, then the duals for all
constraints will be loaded.
- Returns:
slacks – Maps constraints to slacks
- Return type:
dict
-
load_vars(vars_to_load=None)[source]
Load the solution of the primal variables into the value attribute of the variables.
- Parameters:
vars_to_load (list) – A list of the variables whose solution should be loaded. If vars_to_load is None, then the solution
to all primal variables will be loaded.