/** Creates a {@code SoftRoleSlotAssignmentStrategy} with the given slot cost provider and cost threshold. * @param slotCostProvider the slot cost provider * @param costThreshold is a slot-cost limit, beyond which a slot is considered to be too expensive to consider occupying. */ public SoftRoleSlotAssignmentStrategy (SlotCostProvider<T> slotCostProvider, float costThreshold) { this.slotCostProvider = slotCostProvider; this.costThreshold = costThreshold; this.filledSlots = new BooleanArray(); }
@Override protected int numBits(BooleanArray bitSource) { return bitSource.size; }
@Override protected boolean get(BooleanArray bitSource, int index) { return bitSource.get(index); }
@Override protected BooleanArray createObject(int numBits) { BooleanArray array = new BooleanArray(numBits); array.setSize(numBits); return array; }
@Override protected void set(BooleanArray bitDest, int index) { bitDest.set(index, true); }
@Override public BooleanArray copy (Kryo kryo, BooleanArray original) { return new BooleanArray(original); }