How do I obtain a model file with user specified variable name?

27 views
Skip to first unread message

Shuaian Wang

unread,
Nov 29, 2012, 11:49:55 PM11/29/12
to yal...@googlegroups.com

I am using YlLMIP, matlab, and CPLEX. I use
savecplexlp(Constraints, Objective, 'mymodel.txt');
to obtain the model file so that I could check whether there is programming error. However, in such a file, all the variables are x1,x2...x10000, and I would like to name the variables such as "x_resource_1, y_product_2", so that it is easy to understand the model file.
 
I used to use C++ calling CPLEX, and I know that in that context I could use "x[1].setName("resouce1")", and the resulting model file will use "resouce1" rather than "x1". I would like to know whether I could achieve this goal using YALMIP and matlab? Thanks!

Johan Löfberg

unread,
Nov 30, 2012, 2:05:40 AM11/30/12
to yal...@googlegroups.com
You can not do that. If your ultimate goal is to communicate with CPLEX through text-files, then YALMIP is not the tool of choice. The savecplexlp functionality is a hack which not really is intended to be of any significant use.
Reply all
Reply to author
Forward
0 new messages