I have an array as shown below, I want to write it's values in a data file as shown in below, Then read it's values again in another array from the same data file in the same model, So how to read it again from the same data file to same model file with main if possible.
range Number= 0..6;
int Example [i in Number]=i;
execute
{
var o=new IloOplOutputFile("Example.dat");
o.writeln("Example=");
o.writeln(Example);
o.writeln(";");
o.close();
}
You could use IloOplInputFile
The example from documentation is
or since the .dat you have is a .dat well formated file you can use that file directly with