주메뉴 바로가기 본문 바로가기 하단 바로가기

고객지원

기술문의

CPLEX Concert에서 cplex.log 파일 만드는 버

  • 심보경
  • 2005.09.10
  • 조회수 1,637
안녕하세요
VB C++로 MIP문제를 풀고 있습니다.
cplex.log 파일에서 볼 수 있는 정보들을 파일에 저장해서 보고 싶은데요..
--------------------------------------------------------------
Read time = 0.00 sec.
Tried aggregator 1 time.
MIP Presolve eliminated 87 rows and 44 columns.
MIP Presolve modified 38 coefficients.
Reduced MIP has 32 rows, 17 columns, and 80 nonzeros.
Presolve time = 0.01 sec.
Clique table members: 2
MIP emphasis: balance optimality and feasibility
Root relaxation solution time = 0.00 sec.

Nodes Cuts/
Node Left Objective IInf Best Integer Best Node ItCnt Gap Variable B Parent Depth

0 0 infeasible 6

Integer infeasible or unbounded.
Current MIP best bound is infinite.
Solution time = 0.01 sec. Iterations = 6 Nodes = 0
--------------------------------------------------------------
이런 정보들을 보고 싶은데, 비쥬얼 스튜디오에서 작성한 문제는 실행시킬 때 주루룩 보여주기만 해서요.. 파일에 저장해서 분석하려고 합니다만..
--------------------------------------------
IloNum start = Env.getTime();
if ( Cplex.solve() )
{
Cplex_status = (IloCplex::Status) Cplex.getCplexStatus();
Sol_status = (IloAlgorithm::Status) Cplex.getStatus();

f << Cplex_status << "\n";
f << Sol_status << "\n";
f << "Obj: " << objVal << "\n";
}
else
{
switch(Cplex.getStatus())
{
case IloAlgorithm::Unbounded :
f << ": Unbounded" << "\n";
break;
case IloAlgorithm::Infeasible :
f << ": Infeasible" << "\n";
break;
case IloAlgorithm::InfeasibleOrUnbounded :
f << ": Infeasible or Unbounded" << "\n";
break;
case IloAlgorithm::Error :
f << ": An Error occured" << "\n";
break;
case IloAlgorithm::Unknown :
f << ": Status Unknown" << "\n";
break;
}
}
IloNum end = Env.getTime();
f << "걸린 시간 : " << start-end << "seconds" << "\n";
--------------------------------------------
이런식으로 해서는 걸린 시간 조차 파일 출력이 되지 않더라구요.

방법을 알려주세요.

댓글 1

  • 유환주2005-09-12
    IloAlgorithm::setOut()을 참조하시기 바랍니다.

    아마도 f가 출력하려는 로그 파일의 포인터 이겠죠?
    그렇다면 cplex.solve()를 하기전에 "cplex.setOut(&f);"를 간단히 추가해 보세요.
    혹시, 적절한 답변이 아니면 다시 답글을 달아 주세요.
    아이콘삭제

댓글 입력