I am using the IBM cplex optimizer to solve a MIP model. What I want is cplex to log not to console, but to a .txt file. I found a method that mentions this here: http://yalma.fime.uanl.mx/cplex11-manual/refdotnetcplex/html/ILOG.CPLEX.Cplex.SetOut.html
Cplex.SetOut(TextWriter s)
But when I call the method like this, the text file remains empty:
public Cplex Model= new Cplex();
TextWriter TWoutput = File.CreateText("RunOutput.txt"));
//Add variables, constraints and solve the model
Model.SetOut(TWoutput);
I can't find how am i supposed to use this method. I am new to c# and cplex so please explain as simple as you can :)