해당 매개 변수가 설정되어 있지만 CPLEX는 터미널에 많이 인쇄됩니다.
문제
CPP에서 CPLEX를 사용하고 있습니다. Googling 후에는 CPLEX가 터미널에 인쇄에서 피하기 위해 어떤 매개 변수를 설정 해야하는지 알아보십시오.
IloCplex cplex(model);
std::ofstream logfile("cplex.log");
cplex.setOut(logfile);
cplex.setWarning(logfile);
cplex.setError(logfile);
cplex.setParam(IloCplex::MIPInterval, 1000);//Controls the frequency of node logging when MIPDISPLAY is set higher than 1.
cplex.setParam(IloCplex::MIPDisplay, 0);//MIP node log display information-No display until optimal solution has been found
cplex.setParam(IloCplex::SimDisplay, 0);//No iteration messages until solution
cplex.setParam(IloCplex::BarDisplay, 0);//No progress information
cplex.setParam(IloCplex::NetDisplay, 0);//Network logging display indicator
if ( !cplex.solve() ) {
....
}
.
그러나 아직 CPLEX는 그러한 것들을 인쇄합니다 :
Warning: Bound infeasibility column 'x11'.
Presolve time = 0.00 sec. (0.00 ticks)
Root node processing (before b&c):
Real time = 0.00 sec. (0.01 ticks)
Parallel b&c, 4 threads:
Real time = 0.00 sec. (0.00 ticks)
Sync time (average) = 0.00 sec.
Wait time (average) = 0.00 sec.
------------
Total (root+branch&cut) = 0.00 sec. (0.01 ticks)
.
인쇄를 피하는 방법이 있습니까?
해결책 2
이것은 CPLEX파라미터문서에
cplex.setOut(env.getNullStream());
cplex.setWarning(env.getNullStream());
cplex.setError(env.getNullStream());
. 다른 팁
setOut
클래스에서 IloAlgorithm
메소드를 사용합니다 (IloCplex
IloAlgorithm
에서 상속).null 출력 스트림을 매개 변수로 설정하고 화면에 메시지 로깅을 방지 할 수 있습니다.
제휴하지 않습니다 StackOverflow