Commit 4792a64 1 parent 6cfdd49 commit 4792a64 Copy full SHA for 4792a64
File tree 2 files changed +14
-3
lines changed
2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -118,8 +118,9 @@ ItemTypeId InstanceBuilder::add_item_type(
118
118
{
119
119
if (copies <= 0 ) {
120
120
throw std::runtime_error (
121
- " 'onedimensional::InstanceBuilder::add_item_type'"
122
- " requires 'copies > 0'." );
121
+ " onedimensional::InstanceBuilder::add_item_type"
122
+ " ; copies: " + std::to_string (copies)
123
+ + " ." );
123
124
}
124
125
125
126
ItemType item_type;
Original file line number Diff line number Diff line change @@ -199,7 +199,17 @@ std::vector<std::shared_ptr<const Column>> ColumnGenerationPricingSolver::initia
199
199
continue ;
200
200
for (const columngenerationsolver::LinearTerm& element: column.elements ) {
201
201
if (element.row < instance_.number_of_item_types ()) {
202
- filled_demands_[element.row ] += value * element.coefficient ;
202
+ ItemTypeId item_type_id = element.row ;
203
+ ItemPos copies = instance_.item_type (item_type_id).copies ;
204
+ filled_demands_[item_type_id] += value * element.coefficient ;
205
+ if (filled_demands_[item_type_id] > copies) {
206
+ throw std::logic_error (
207
+ " rectangleguillotine::ColumnGenerationPricingSolver::initialize_pricing"
208
+ " ; item_type_id: " + std::to_string (item_type_id)
209
+ + " ; copies: " + std::to_string (copies)
210
+ + " ; filled_demands: " + std::to_string (filled_demands_[item_type_id])
211
+ + " ." );
212
+ }
203
213
} else {
204
214
filled_width_ += value * element.coefficient ;
205
215
}
You can’t perform that action at this time.
0 commit comments