[SCIP] reading in indexed sets with ZIMPL
Benjamin Müller
benjamin.mueller at zib.de
Tue Jul 5 17:26:03 CEST 2016
Dear James,
please note that "<3s,1n,2n> 4s" is a mapping and can not be stored in a
set variable. What you probably want to do is something like:
set Q := { read "haha.txt" as "<3s,1n,2n>" };
param cost[Q] := read "haha.txt" as "<3s,1n,2n> 4s"
Here:
http://zimpl.zib.de/download/zimpl.pdf
you find the ZIMPL user guide containing different examples, e.g., how
to read in sets and parameters.
Best,
Benny
On 04.07.2016 12:08, James Cussens wrote:
> I am having trouble reading in indexed sets with ZIMPL. The following
> ZIMPL input:
>
> STARTS
> set Q := { <"ab",1,2>, <"bc",2,3>, <"de",4,5> };
>
> #set cost[Q] := { read "haha.txt" as "<3s,1n,2n> 4s" };
> param cost[Q] := read "haha.txt" as "<3s,1n,2n> 4s" ;
> ENDS
>
> works fine with these 3 lines in haha.txt:
>
> 1:2:ab:con1
> 2:3:bc:con2
> 4:5:de:con3
>
> So all is well with an indexed parameter. But when I uncomment the set
> definition line (and comment out the param one) I get:
>
>
> ****************************************************
> * Zuse Institute Mathematical Programming Language *
> * Release 3.3.3 Copyright (C)2012 by Thorsten Koch *
> ****************************************************
> * This is free software and you are welcome to *
> * redistribute it under certain conditions *
> * ZIMPL comes with ABSOLUTELY NO WARRANTY *
> ****************************************************
>
> Reading test.zpl
> Reading haha.txt
> *** Error 214: Wrong type of set elements -- wrong read template?
> *** File: test.zpl Line 3
> *** set cost[Q] := { read "haha.txt" as "<3s,1n,2n> 4s" };
> *** ^^^
>
> I notice that none of the examples in the ZIMPL manual involve reading
> in indexed sets.
>
> Any help gratefully received!
>
> James
>
> --
> James Cussens
> Dept of Computer Science &
> York Centre for Complex Systems Analysis
> Room 326, The Hub, Deramore Lane Tel +44 (0)1904 325371
> University of York Fax +44
> (0)1904 500159
> York YO10 5GE, UK http://www.cs.york.ac.uk/~jc
> <http://www.cs.york.ac.uk/%7Ejc>
> http://www.york.ac.uk/docs/disclaimer/email.htm
>
>
> _______________________________________________
> Scip mailing list
> Scip at zib.de
> http://listserv.zib.de/mailman/listinfo/scip
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.zib.de/pipermail/scip/attachments/20160705/ee27b664/attachment.html>
More information about the Scip
mailing list