Skip to content

Commit

Permalink
TMP: log skipping
Browse files Browse the repository at this point in the history
  • Loading branch information
sebrockm committed Oct 14, 2023
1 parent 8a78cbc commit 529400a
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions tsplp/src/MtspModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,13 +364,20 @@ void tsplp::MtspModel::BranchAndCutSolve(
switch (solutionStatus)
{
case Status::Unbounded:

Check warning on line 366 in tsplp/src/MtspModel.cpp

View check run for this annotation

Codecov / codecov/patch

tsplp/src/MtspModel.cpp#L366

Added line #L366 was not covered by tests
throw std::logic_error("LP solution is unbounded. This must not happen. Maybe some "
"constraints are missing.");
throw std::logic_error(
m_name

Check warning on line 368 in tsplp/src/MtspModel.cpp

View check run for this annotation

Codecov / codecov/patch

tsplp/src/MtspModel.cpp#L368

Added line #L368 was not covered by tests
+ ": LP solution is unbounded. This must not happen. Maybe some "
"constraints are missing.");
case Status::Error:

Check warning on line 371 in tsplp/src/MtspModel.cpp

View check run for this annotation

Codecov / codecov/patch

tsplp/src/MtspModel.cpp#L370-L371

Added lines #L370 - L371 were not covered by tests
throw std::logic_error("Unexpected error happened while solving LP.");
throw std::logic_error(m_name + ": Unexpected error happened while solving LP.");
case Status::Timeout: // timeout will be handled at the beginning of the next iteration

Check warning on line 373 in tsplp/src/MtspModel.cpp

View check run for this annotation

Codecov / codecov/patch

tsplp/src/MtspModel.cpp#L373

Added line #L373 was not covered by tests
case Status::Infeasible: // fixation of some variable makes this infeasible, skip it
{
std::unique_lock lock { print_mutex };
std::cout << m_name << ", thread " << threadId << ": Infeasible, skipping."
<< std::endl;
continue;
}
case Status::Optimal:
break;
}
Expand Down Expand Up @@ -401,7 +408,12 @@ void tsplp::MtspModel::BranchAndCutSolve(
// currentLowerBound is not necessarily the global LB, but either way there is no need
// trying to improve it further
if (currentLowerBound >= currentUpperBound)
{
std::unique_lock lock { print_mutex };
std::cout << m_name << ", thread " << threadId
<< ": currentLowerBound >= currentUpperBound, skipping" << std::endl;
continue;
}

// fix variables according to reduced costs
for (auto v : model.GetBinaryVariables())
Expand Down Expand Up @@ -478,7 +490,12 @@ void tsplp::MtspModel::BranchAndCutSolve(
currentLowerBound, CreatePathsFromVariables(model));
}

continue;
{
std::unique_lock lock { print_mutex };
std::cout << m_name << ", thread " << threadId
<< ": non-fractional solution found" << std::endl;
continue;
}
}

// As a last resort, split the problem on a fractional variable
Expand Down

0 comments on commit 529400a

Please sign in to comment.