KKobuszewski / optimcut

Simple library to optimize leftovers from cutting slices from longer material pieces (single dimension).
MIT License
0 stars 0 forks source link

smth wrong with leftovers / cost_function??? #1

Closed KKobuszewski closed 1 year ago

KKobuszewski commented 1 year ago

test leftovers more carefully

KKobuszewski commented 1 year ago

There was a problem with proper including the last leftover. It's solved with additional call after the loop

""" for (int it=0; it<n; it++) { if (current_id != material_id[it]) { leftovers[current_id] = material_length[current_id] - sum; sum = 0.0; current_id += 1; } sum += state[it]; } // NOTE: Loop ends before counting last leftover // need to find last leftover leftovers[current_id] = material_length[current_id] - sum; """