softScore += Math.min(safetyAvailable, 0) * resource.getLoadCostWeight();
balanceAvailable -= processUsage;
}
private void removeProcessAssignment(MrProcessAssignment processAssignment) {
MrResource resource = machineCapacity.getResource();
long processUsage = processAssignment.getUsage(resource);
if (!machineCapacity.isTransientlyConsumed() || processAssignment.isMoved()) {
// Capacity constraints + Transient usage constraints
hardScore -= Math.min(maximumAvailable, 0);
maximumAvailable += processUsage;
hardScore += Math.min(maximumAvailable, 0);
}
// Load cost
softScore -= Math.min(safetyAvailable, 0) * resource.getLoadCostWeight();
safetyAvailable += processUsage;
softScore += Math.min(safetyAvailable, 0) * resource.getLoadCostWeight();
balanceAvailable += processUsage;
}