Originally posted by: SystemAdmin
I am quite sure that the problem is not with CPLEX but with the way you specify the file to write to. What is the current working directory when you call WriteSolution()? Can you please double check that the relative path you specify indeed exists when you prepend the current working directory? Maybe something like this
string cwd = Directory.GetCurrentDirectory(); string dir = cwd +
"/../../../../include/ilcplex"; string path = dir +
"/1.txt"; Console.WriteLine(
"Current directory is {0}", cwd); Console.WriteLine(
"Path to file is {0}", dir); Console.WriteLine(
"File name is {0}", path);
if ( Directory.Exists(dir) )
{ Console.WriteLine(
"Directory {0} exists", dir);
}
else
{ Console.WriteLine(
"Directory {0} does not exist!", dir);
}
if ( File.Exists(path) )
{ Console.WriteLine(
"File {0} exists", path);
}
else
{ Console.WriteLine(
"File {0} does not exist", path);
} cplex.WriteSolutions(
"../../../../include/ilcplex/1.txt");
What is the output of this? Do the directory and file exist?
#CPLEXOptimizers#DecisionOptimization