Reputation: 23
I have an optimization model has to be run within a simulation model every time at each simulation iteration. However, it displays log, error, warning and results as output of Cplex at each iteration. How can I set it off?
I found following link for the same question in python, however I was not able to find the Java command:
Cplex Python how to avoid printing the output
I wonder if anyone can help me with that. Thank you.
Upvotes: 1
Views: 1884
Reputation: 283
I used the following code and it works.
IloCplex cplex = new IloCplex();
cplex.setOut(null);
Upvotes: 5
Reputation: 1460
Try
public class NullOutputStream extends OutputStream {
@Override
public void write(int b) throws IOException {
}
}
and then
setOut(new NullOutputStream());
Upvotes: 0
Reputation: 14656
You can redirect CPlex's output using the setOut(OutputStream s)
method:
IloCplex cplex = new IloCplex();
cplex.setOut(...);
Upvotes: 2