<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 href="http://www.cs.york.ac.uk/~jc" target="_blank">http://www.cs.york.ac.uk/~jc</a><br><a href="http://www.york.ac.uk/docs/disclaimer/email.htm" target="_blank">http://www.york.ac.uk/docs/disclaimer/email.htm</a></div>
</div>