Hi all!
I try to figure out how can I implement the following usecase:
Imagine, I have a simple model(just to explain). Smth like:
int a http://1..2 = 2,2;
int d http://1..2 = ...;
dvar int+ x1;
dvar int+ x2;
minimize x1+x2;
subject to{
a[1]*x1>=d[1];
a[2]*x2>=d[2];
}
And now I want to test my model for randomly generated data d has the same value all the time.
What is the easiest way to do that? Looks like the simple usecase, but I stuck here...
Actually, I generate the data in MATLAB, may I somehow implement the described above case using API for example? My real model is huge and I cannot easily find the needed data piece in the A matrix.
Thank you in advance for the help!
Topic
This topic has been locked.
3 replies
Latest Post
 20130117T06:58:52Z by SystemAdmin
ACCEPTED ANSWER
Pinned topic How to restart the model with different data?
20130116T16:59:09Z

Answered question
This question has been answered.
Unanswered question
This question has not been answered yet.
Attachments
Updated on 20130117T06:58:52Z at 20130117T06:58:52Z by SystemAdmin

ACCEPTED ANSWER
Re: How to restart the model with different data?
20130116T22:03:11Z in response to RobopThere are a bunch of ways to do this, but the easiest one might be a script in Matlab that calls ILOG using the oplrun command.
Something like:
 Generate the parameters
 Write a .Dat file
 Move the .Dat file into the OPL folder (use the "dos" command in Matlab)
 Execute the model (use the oplrun command)
Repeat
Use Google and the IlOG manual for the syntaxes. If something isn't clear, let me know. 
ACCEPTED ANSWER
Re: How to restart the model with different data?
20130116T22:11:42Z in response to RobopYour other post specifically mentioned .lp files. Another way to do this is to use ILOG to get a single .lp file, then use the Matlab API.
The API will create a cplex object "my_model" (you give the name, that is just an example), with the A matrix stored in my_model.A.
You can change it with simple matlab commands like my_model.A(4,10) = 1.32. Then resolve.
As for your model being huge and not being able to find what you need in the A matrix, are you searching using matlab or you just can't find it with your eyes? Use Matlab tools like find, min, max, or whatever else you need. But if you can't find what you need in the A matrix, Cplex / ILOG can't do that for you. It just solves what you give it. You have to manage the problem somehow. 
ACCEPTED ANSWER
Re: How to restart the model with different data?
20130117T06:58:52Z in response to RobopIs this the same as this question?