@Override
public void accumulate(Serializable context, Object value) {
ContextData contextData = (ContextData)context;
FirefightersDepartmentDistanceCalculationData data = (FirefightersDepartmentDistanceCalculationData)value;
FirefightersDepartment currentDepartment = data.getDepartment();
Emergency emergency = data.getEmergency();
float difX = currentDepartment.getX() - xs[emergency.getLocation().getLocationX()];
float difY = currentDepartment.getY() - ys[emergency.getLocation().getLocationY()];
double difTotal = Math.sqrt(Math.pow(((double)difX),2d) + Math.pow(((double)difY),2d));
if(contextData.selectedDepartment == null || difTotal < contextData.minDistance){
contextData.minDistance = difTotal;