[SCIP] Fw: Aw: Re: Convert a set of tuples to table

Thorsten Koch koch at zib.de
Tue Feb 9 22:31:44 CET 2016


Hi Natalie,

try something like

param possible[<c,i> in CI] := 2 * c - i;

or you can do also do

param possible[<c,i> in CI] := if c > 5 then i + c else 2 * i end;

But this is in the documentation.
http://zimpl.zib.de/download/zimpl.pdf

Best regards,
Thorsten



Am 08.02.16 um 12:03 schrieb Natalie Hauck:
> Hi Thorsten and all,
> thank you very much for your quick response and your support.
> As I am a beginner in programming I would rather just do it in ZIMPL ;).
> Isn´t it possible to convert the set of tuples ({<0,0,3>,..., <2,0,0>}) to a 
> table so that I create a new parameter as displayed below (static option):
>   param possible [CI]:=
>       |1, 2, 3|
>   |1 |2, 0, 0|
>   |2 |1, 1, 0|
>   |3 |1, 0, 2|
>   |4 |0, 2, 1|
>   |5 |0, 1, 2|
>   |6 |0, 0, 3|; or do you have another idea how to do it in ZIMPL???
> I really appreciate your help.
> Thanks in advance,
> Natalie
> *Gesendet:* Montag, 08. Februar 2016 um 10:51 Uhr
> *Von:* "Thorsten Koch" <koch at zib.de>
> *An:* "Natalie Hauck" <nataliehauck at gmx.net>, scip at zib.de
> *Betreff:* Re: [SCIP] Convert a set of tuples to table
> Hi Natalie,
> 
>> - create an ouput in form of a table with those tuples, so that I could read the
>> matrix from a txt file.
> 
> this is in general a good idea for complicated data. But I would not use
> Zimpl to generate the file but a nice scripting language like phython/awk/perl
> whatever you like. Then you can use the read statement to read the data into
> a param or set.
> 
> Best regards,
> Thorsten
> 
> 
> 
> Am 08.02.16 um 10:43 schrieb Natalie Hauck:
>> Hi Scip-Team,
>> thank you very much for your help :)! I really appreciate it.
>> I have a question regarding a set of tuples. I generated with your help:
>> set C := {0 ..3};
>> set ZSK := {<a,b,c> in C*C*C with 4 * x + 5 * y + 3 * z <= 11 and 4 * x + 5
>> * y + 3 * z >= 9};
>> do print ZSK;
>> and ZSK e.g contains now : {<0,0,3>,..., <2,0,0>}; This is great.
>> Unfortunately, I encountered another problem and I thought you might have a
>> smart idea. I would like to either
>> - convert the set of tuples to a table (array) so that I create a new parameter
>> as displayed below (static option):
>> param possible [CI]:=
>> |1, 2, 3|
>> |1 |2, 0, 0|
>> |2 |1, 1, 0|
>> |3 |1, 0, 2|
>> |4 |0, 2, 1|
>> |5 |0, 1, 2|
>> |6 |0, 0, 3|;
>> or
>> - create an ouput in form of a table with those tuples, so that I could read the
>> matrix from a txt file.
>> I would again very much appreciate any support from your side.
>> Best regards,
>> Natalie
>>
>>
>>
>> _______________________________________________
>> Scip mailing list
>> Scip at zib.de
>>http://listserv.zib.de/mailman/listinfo/scip
>>
> 
> --
> The important thing is not to stop questioning.
> Curiosity has its own reason for existing. -- Albert Einstein
> ______________________________________________________________________
> Prof. Dr. Thorsten Koch / Technische Universität Berlin
> www.zib.de/koch <http://www.zib.de/koch> / and
> koch at zib.de / Zuse Institute Berlin (ZIB)
> _____________________/ Takustraße 7, 14195 Berlin, Germany
> and also Phone +49-30-84185-213, Fax -269
> KOBV : Kooperativer Bibliotheksverbund Berlin Brandenburg
> digiS: Servicestelle Digitalisierung des Landes Berlin
> ______________________________________________________________________
> 
> 
> 
> _______________________________________________
> Scip mailing list
> Scip at zib.de
> http://listserv.zib.de/mailman/listinfo/scip
> 

-- 
The important thing is not to stop questioning.
Curiosity has its own reason for existing.          -- Albert Einstein
______________________________________________________________________
Prof. Dr. Thorsten Koch /       Technische Universität Berlin
www.zib.de/koch        /                   and
koch at zib.de           /          Zuse Institute Berlin (ZIB)
_____________________/       Takustraße 7, 14195 Berlin, Germany
       and also                Phone +49-30-84185-213, Fax -269
KOBV : Kooperativer Bibliotheksverbund Berlin Brandenburg
digiS: Servicestelle Digitalisierung des Landes Berlin
______________________________________________________________________


More information about the Scip mailing list