Skip to content

Conversation

@blegat
Copy link
Contributor

@blegat blegat commented Nov 18, 2025

Otherwise I get an error when changing the objective function as it think the issue is that ObjectiveSense is not supported, not that the model should be wiped out and copy_to should be called again

@klamike
Copy link
Contributor

klamike commented Nov 21, 2025

Isn't a corresponding setter required here for MOI to actually change the sense? Something like

function MOI.set(
    model::Optimizer,
    ::MOI.ObjectiveSense,
    sense::MOI.OptimizationSense,
)
    model.model.meta.minimize = isequal(sense, MOI.MIN_SENSE)
    return
end

@blegat
Copy link
Contributor Author

blegat commented Nov 21, 2025

Being supported means that it can either be set through MOI.copy_to (one-shot interface) or through MOI.set (incremental interface). Here, ExaModels only implements the one-shot so no need for MOI.set. Unless the solver supports efficient handling of resolve after problem modification, there is no need to implement it in the MOI interface. What will happen then is that the ExaModel model will be emptied and copy_to will be run again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants