[Cmpl] Array of sets in data file

Kamil Figiela kfigiela at agh.edu.pl
Tue Nov 26 05:47:06 EST 2013


Hello Mike,

Thank you for the response. If I understand correctly, for the solution you propose I need to hardcode "setC["Y"] := setY;" lines in the model (and number of them depends on setB in this instance)? I was thinking about something like {i in setB: setC[i] := set%i;} - where %i is substituted with set member name.

For the time being, I will probably generate the CMPL file and use include directive.

Best,
Kamil


Wiadomość napisana przez Mike Steglich <mike.steglich at th-wildau.de> w dniu 25 lis 2013, o godz. 16:41:

> Hello Kamil,
> 
> CmplData is intended to read raw data into Cmpl models. That means it is not possible to use parameters or sets that are defined in the cmpData file for the data assignment to another set or parameter in the cmplData file.
> 
> I would like to propose to define the subsets in the cmplData file and to assign this sets to a parameter array within your Cmpl model:
> 
> ---- cmplData 
> %setA set < A B C >
> %setB set < X Y >
> 
> %setX set < A B >
> %setY set < C >
> 
> .... Cmpl 
> setC["X"] := setX;
> setC["Y"] := setY;
> 
> Cheers,
> 
> Mike
> 
> Am 25.11.2013 um 15:01 schrieb Kamil Figiela:
> 
>> Hello!
>> 
>> I have defined the following sets in my data file:
>> 
>> %setA set < A B C >
>> %setB set < X Y >
>> 
>> Now I want to define a array of sets that defines relation between sets A and B, so in the parameters section I can write:
>> 
>> setC["X"] := set("A", "B");
>> setC["Y"] := set("C");
>> 
>> and it works. How express the same in the data file? I have tried several options, but it didn't work. I created example program https://gist.github.com/kfigiela/7641560
>> 
>> Thanks,
>> Kamil Figiela_______________________________________________
>> Cmpl mailing list
>> Cmpl at list.coin-or.org
>> http://list.coin-or.org/mailman/listinfo/cmpl
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4819 bytes
Desc: not available
URL: <http://list.coin-or.org/pipermail/cmpl/attachments/20131126/9b9b5110/attachment.p7s>


More information about the Cmpl mailing list