pyepo.dsl.compiled¶
Generic compiled-problem base for the PyEPO DSL.
compiledBase is mixed with a backend base (optXxxModel) to form a
concrete compiled problem, e.g. compiledGrbProblem(compiledBase,
optGrbModel). It carries the backend-agnostic objective handling — scattering
a predicted cost onto its variable positions and solving — while the concrete
subclass builds the solver model and provides the read / write hooks.
Classes¶
Backend-agnostic compiled DSL problem. Mixed with an |
Module Contents¶
- class pyepo.dsl.compiled.compiledBase(problem, params=None)¶
Bases:
pyepo.model.opt.optModelBackend-agnostic compiled DSL problem. Mixed with an
optXxxModel.- problem¶
- params¶
- property c_pred_index¶
Variable positions the predicted cost lands on, or
Nonewhen every variable is predicted (the default).
- setObj(c)¶
Set the objective from a predicted cost of length
num_cost, scattered onto the known fixed costs.
- solve()¶
Solve and return the full decision-vector solution (length
num_vars) with its objective value.
- addConstr(coefs, rhs)¶
A method to add a new constraint. Subclasses should override.
- Parameters:
coefs – coefficients of the new constraint
rhs – right-hand side of new constraint
- Returns:
new model with the added constraint
- Return type:
- relax()¶
A method to relax the MIP model. Subclasses should override.