Forum Discussion
FICO
3 years agoCommunity Manager
A problem with the readln function
Hello, I am having a problem with the readln() function. In fact, I want to read an instance file to start the optimization in a subsequent moment. In particular, I get the following error: Mosel:...
FICO
3 years agoCommunity Manager
When you are working with 'readln'/'read' the contents of the file that you are reading must match exactly what you are trying to read from your Mosel model: uncommenting the lines
!readln("NAME", fileName)
!readln("COMMENT")
in your latest code example above will match the format of your input file and input values are read in correctly.
You may want to add a test after the individual read statements, such as:
procedure testread(num: integer)
numread:=getparam("nbread")
if numread<>num then
writeln("Read error (expected:", num, " items read:", numread, ")")
exit(1)
end-if
end-procedure
!...
readln("FAMILIES", Nf)
testread(2)
readln("BINS_SECTION")
testread(1)
Nj:=0
U(0):=0
V(0):=0
forall(t in 1..Nt)do
readln(id, Wcat(t), Ccat(t), L(t), U(t))
testread(5)Related Content
Related Content
Another problem with the readln() function
Hello, I have already posted a question on this topic (https://community.fico.com/s/question/0D54w0000CcOF2iCQG/a-problem-with-the-readln-function) without, unfortunately, getting any answer. I...3 years agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum2 unread comments2 unread0Views0likes2CommentsProblem with Xpress installation: Module `mminsight' not found.
I attempted a new installation of Xpress and Insight on a Windows 11 PC. (Downloaded files yesterday.) xp9.8.0_win_x86_64_setup.exe and FICO_Xpress_Insight_5.16.1_Community_Edition_setup.exe installe...8 months agoPlace FICO® Xpress Optimization ForumFICO® Xpress Optimization Forum1 unread comment1 unread5Views0likes1Comment