<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Dear James,<br>
<br>
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:<br>
<br>
<div> set Q := { read "haha.txt" as "<3s,1n,2n>" };</div>
param cost[Q] := read "haha.txt" as "<3s,1n,2n> 4s"<br>
<br>
Here:<br>
<br>
<a class="moz-txt-link-freetext" href="http://zimpl.zib.de/download/zimpl.pdf">http://zimpl.zib.de/download/zimpl.pdf</a><br>
<br>
you find the ZIMPL user guide containing different examples, e.g.,
how to read in sets and parameters.<br>
<br>
<br>
Best,<br>
Benny<br>
<br>
<div class="moz-cite-prefix">On 04.07.2016 12:08, James Cussens
wrote:<br>
</div>
<blockquote
cite="mid:CALQgqO0A=dCkQam2n50GochhSXqX7miNCe7am=+m8w_F94twtw@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>I am having trouble reading in indexed sets with ZIMPL. The
following ZIMPL input:</div>
<div><br>
</div>
STARTS<br clear="all">
<div>
<div>set Q := { <"ab",1,2>, <"bc",2,3>,
<"de",4,5> };</div>
<div><br>
</div>
<div>#set cost[Q] := { read "haha.txt" as "<3s,1n,2n>
4s" };</div>
<div>param cost[Q] := read "haha.txt" as "<3s,1n,2n>
4s" ;</div>
</div>
<div>ENDS</div>
<div><br>
</div>
<div>works fine with these 3 lines in haha.txt:</div>
<div><br>
</div>
<div>
<div>1:2:ab:con1</div>
<div>2:3:bc:con2</div>
<div>4:5:de:con3</div>
</div>
<div><br>
</div>
<div>So all is well with an indexed parameter. But when I
uncomment the set definition line (and comment out the param
one) I get:</div>
<div><br>
</div>
<div><br>
</div>
<div>
<div>****************************************************</div>
<div>* Zuse Institute Mathematical Programming Language *</div>
<div>* Release 3.3.3 Copyright (C)2012 by Thorsten Koch *</div>
<div>****************************************************</div>
<div>* This is free software and you are welcome to *</div>
<div>* redistribute it under certain conditions *</div>
<div>* ZIMPL comes with ABSOLUTELY NO WARRANTY *</div>
<div>****************************************************</div>
<div><br>
</div>
<div>Reading test.zpl</div>
<div>Reading haha.txt</div>
<div>*** Error 214: Wrong type of set elements -- wrong read
template?</div>
<div>*** File: test.zpl Line 3</div>
<div>*** set cost[Q] := { read "haha.txt" as "<3s,1n,2n>
4s" };</div>
<div>***
^^^</div>
</div>
<div><br>
</div>
<div>I notice that none of the examples in the ZIMPL manual
involve reading in indexed sets.</div>
<div><br>
</div>
<div>Any help gratefully received!</div>
<div><br>
</div>
<div>James</div>
<div><br>
</div>
-- <br>
<div class="gmail_signature" data-smartmail="gmail_signature">James
Cussens<br>
Dept of Computer Science &<br>
York Centre for Complex Systems Analysis<br>
Room 326, The Hub, Deramore Lane Tel +44 (0)1904
325371<br>
University of York Fax
+44 (0)1904 500159<br>
York YO10 5GE, UK <a
moz-do-not-send="true" href="http://www.cs.york.ac.uk/%7Ejc"
target="_blank">http://www.cs.york.ac.uk/~jc</a><br>
<a moz-do-not-send="true"
href="http://www.york.ac.uk/docs/disclaimer/email.htm"
target="_blank">http://www.york.ac.uk/docs/disclaimer/email.htm</a></div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Scip mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Scip@zib.de">Scip@zib.de</a>
<a class="moz-txt-link-freetext" href="http://listserv.zib.de/mailman/listinfo/scip">http://listserv.zib.de/mailman/listinfo/scip</a>
</pre>
</blockquote>
<br>
</body>
</html>