| 480 | } |
| 481 | |
| 482 | static void add_bucket(const vector<df::unit*> &bucket, vector<df::unit*> &units, vector<float> &intervals, vector<float> &weights, float weight) { |
| 483 | if (bucket.empty()) |
| 484 | return; |
| 485 | if (config.prefer_new_arrivals) { |
| 486 | vector<df::unit*> new_bucket, old_bucket; |
| 487 | for (auto unit : bucket) { |
| 488 | if (recent_units.contains(unit->id)) |
| 489 | new_bucket.push_back(unit); |
| 490 | else |
| 491 | old_bucket.push_back(unit); |
| 492 | } |
| 493 | add_bucket_to_vectors(new_bucket, units, intervals, weights, weight * RECENT_UNIT_MULTIPLIER); |
| 494 | add_bucket_to_vectors(old_bucket, units, intervals, weights, weight); |
| 495 | } else { |
| 496 | add_bucket_to_vectors(bucket, units, intervals, weights, weight); |
| 497 | } |
| 498 | } |
| 499 | |
| 500 | #define DUMP_BUCKET(name) \ |
| 501 | DEBUG(cycle,out).print("bucket: " #name ", size: {}\n", name.size()); \ |
no test coverage detected