I am using IBM ILOG Script. Where can I find the documentation of the methods and datamembers of the OPL classes? I have found that for C++, Java and .Net. I tried calling the analogues methods in the script but it failed.
I have a parameter d in my CSP that should be incremented if there is no feasible solution, starting with 0 and going up to at most 5 (d=0..5). What is the most intelligent way to do that?
One way is to turn the parameter into an integer dvar and minimize its value. If I could tell the CP solver to try its values in the 0..5 order then I would be happy.
Another way is to increment the model parameter on failure and re-run the solver. Unfortunately it's rather tricky, I am following the example at IloOplModel in the help. My parameters are coming from a file and I ended up copying manually the parameters... It works but messy. In C++ I would just call a copy constructor to copy the data. Is there a way to make a copy of data coming from a file but changing some of the values?
The mulprod example does something similar but I failed to same, I got an error message.
Any help is greatly appreciated.
Pinned topic How to increment a model parameter as long as the problem is infeasible?
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2012-08-30T19:44:00Z at 2012-08-30T19:44:00Z by SystemAdmin
SystemAdmin 110000D4XK378 Posts
Re: How to increment a model parameter as long as the problem is infeasible?2012-08-30T19:44:00ZThis is the accepted answer. This is the accepted answer.Hi,
the ILOG Script reference manual can be found here: http://pic.dhe.ibm.com/infocenter/cosinfoc/v12r4/index.jsp?topic=%2Filog.odms.ide.help%2Frefjsopl%2Fhtml%2Fintro.html
About modifying data and solving iteratively, I would invite you to look at one of the distributed sample: multiperiod production planning, in particular the script in mulprod_main.mod.
The section of the script that updates the data "flour's capacity" is:
produce = new IloOplModel(def,cplex); capFlour++; data.Capacity[ "flour"] = capFlour; produce.addDataSource(data); produce.generate();
Could you post your code and the error you're getting?
To be able to update your data "d", make sure it has "external initialization":