-
Notifications
You must be signed in to change notification settings - Fork 97
Closed
Description
To date, I'm not sure if anyone has dug into the modification API yet. I was about to start writing tests (#354) and had some thoughts.
In addition to some function modifications, we currently have two modifyconstraint! methods:
modifyconstraint!(m, c::ConstraintIndex{F,S}, new_set::S)
modifyconstraint!(m, c::ConstraintIndex{F,S}, new_function::F)
Considering the rest of the API, doesn't it make more sense to make these set! methods?
set!(m::ModelLike, ::ConstraintFunction, c::ConstraintIndex{F,S}, new_function::F)
set!(m::ModelLike, ::ConstraintSet, c::ConstraintIndex{F,S}, new_set::S)
Furthermore, instead of modifyconstraint! and modifyobjective!, we could have
canmodify(m, ::ConstraintFunction, c::Type{ConstraintIndex{F,S}}, change::Type{AbstractFunctionModification})
modify!(m, ::ConstraintFunction, c::ConstraintIndex{F,S}, change::AbstractFunctionModification)
canmodify(m, ::ObjectiveFunction, change::Type{AbstractFunctionModification})
modify!(m, ::ObjectiveFunction, change::AbstractFunctionModification)
Edit: we could also change the transformconstraint to
canmodify(m, ::ConstraintSet, c::Type{ConstraintIndex{F,S1}}, ::Type{S2})
c2 = modify!(m, ::ConstraintSet, c::ConstraintIndex{F,S1}, new_set::S2)
blegat and joaquimg
Metadata
Metadata
Assignees
Labels
No labels