Skip to content
Merged

Dev 2 #248

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/box/optimize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,15 @@ packingsolver::box::Output packingsolver::box::optimize(
}
}

if (algorithm_formatter.end_boolean()) {
algorithm_formatter.end();
return output;
}
if (parameters.timer.needs_to_end()) {
algorithm_formatter.end();
return output;
}

int last_algorithm =
(use_column_generation)? 4:
(use_dichotomic_search)? 3:
Expand Down
9 changes: 9 additions & 0 deletions src/irregular/optimize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,15 @@ packingsolver::irregular::Output packingsolver::irregular::optimize(
if (instance.objective() == Objective::Knapsack)
algorithm_formatter.update_knapsack_bound(instance.item_profit());

if (algorithm_formatter.end_boolean()) {
algorithm_formatter.end();
return output;
}
if (parameters.timer.needs_to_end()) {
algorithm_formatter.end();
return output;
}

int last_algorithm =
(use_column_generation)? 4:
(use_dichotomic_search)? 3:
Expand Down
9 changes: 9 additions & 0 deletions src/onedimensional/optimize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,15 @@ packingsolver::onedimensional::Output packingsolver::onedimensional::optimize(
}
}

if (algorithm_formatter.end_boolean()) {
algorithm_formatter.end();
return output;
}
if (parameters.timer.needs_to_end()) {
algorithm_formatter.end();
return output;
}

int last_algorithm =
(use_column_generation)? 4:
(use_dichotomic_search)? 3:
Expand Down
2 changes: 1 addition & 1 deletion src/rectangle/branching_scheme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ BranchingScheme::BranchingScheme(
return item_1.bl_corner.x < item_2.bl_corner.x;
});
for (BinPos c = 0; c < solution_bin.copies; ++c) {
bool new_bin = true;
bool new_bin = 1;
for (const auto& solution_item: solution_items) {
//std::cout << "j " << solution_item.j
// << " x " << solution_item.bl_corner.x
Expand Down
6 changes: 3 additions & 3 deletions src/rectangle/branching_scheme.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ class BranchingScheme
bool rotate;

/**
* - < 0: the item is inserted in the last bin
* - 0: the item is inserted in a new bin with horizontal direction
* - 1: the item is inserted in a new bin with vertical direction
* - 0: the item is inserted in the last bin
* - 1: the item is inserted in a new bin with horizontal direction
* - 2: the item is inserted in a new bin with vertical direction
*/
int8_t new_bin;

Expand Down
9 changes: 9 additions & 0 deletions src/rectangle/optimize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,15 @@ packingsolver::rectangle::Output packingsolver::rectangle::optimize(
}
}

if (algorithm_formatter.end_boolean()) {
algorithm_formatter.end();
return output;
}
if (parameters.timer.needs_to_end()) {
algorithm_formatter.end();
return output;
}

int last_algorithm =
(use_column_generation)? 5:
(use_dichotomic_search)? 4:
Expand Down
9 changes: 9 additions & 0 deletions src/rectangleguillotine/optimize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,15 @@ packingsolver::rectangleguillotine::Output packingsolver::rectangleguillotine::o
}
}

if (algorithm_formatter.end_boolean()) {
algorithm_formatter.end();
return output;
}
if (parameters.timer.needs_to_end()) {
algorithm_formatter.end();
return output;
}

int last_algorithm =
(use_column_generation)? 5:
(use_dichotomic_search)? 4:
Expand Down
Loading