MiniZinc/minizinc-python

changing the 'solve' item in a Model()

tias opened this issue · 1 comments

tias commented

Hey Yip, MiniZinc team,

I know we can do model.add_string().

I would like to change the objective of a model. If I use add_string(), it just adds the new solve entry and then complains that a model can not have two 'solve' entries.

Would there be a way for your API to detect this, and overwrite the previous solve? otherwise I will have to book-keep the solve entry myself, could be nicer behind the API?

I'm not sure how you handle that with inst.child(), the use case is similar (repeated solving with changing objective).

Thanks,
Tias

Hi Tias,

I am certainly interested in these issues and have implemented some incremental search methods that would use this functionality. Currently the modeller is in charge of the bookkeeping. Although I agree that this is not ideal and should probably change, I would tackle this issue together with a generally modelling interface for MiniZinc Python. To me it makes little sense for this change until then.