diff --git a/jsprit-core/src/main/java/jsprit/core/problem/constraint/ServiceLoadActivityLevelConstraint.java b/jsprit-core/src/main/java/jsprit/core/problem/constraint/ServiceLoadActivityLevelConstraint.java index 38a709b7..45898101 100644 --- a/jsprit-core/src/main/java/jsprit/core/problem/constraint/ServiceLoadActivityLevelConstraint.java +++ b/jsprit-core/src/main/java/jsprit/core/problem/constraint/ServiceLoadActivityLevelConstraint.java @@ -35,37 +35,23 @@ class ServiceLoadActivityLevelConstraint implements HardActivityStateLevelConstr Capacity prevMaxLoad; if(prevAct instanceof Start){ futureMaxLoad = stateManager.getRouteState(iFacts.getRoute(), StateFactory.MAXLOAD, Capacity.class); -// futureMaxLoad = (int)stateManager.getRouteState(iFacts.getRoute(), StateFactory.MAXLOAD).toDouble(); prevMaxLoad = stateManager.getRouteState(iFacts.getRoute(), StateFactory.LOAD_AT_BEGINNING, Capacity.class); -// prevMaxLoad = (int)stateManager.getRouteState(iFacts.getRoute(), StateFactory.LOAD_AT_BEGINNING).toDouble(); } else{ futureMaxLoad = stateManager.getActivityState(prevAct, StateFactory.FUTURE_MAXLOAD, Capacity.class); -// futureMaxLoad = (int) stateManager.getActivityState(prevAct, StateFactory.FUTURE_MAXLOAD).toDouble(); prevMaxLoad = stateManager.getActivityState(prevAct, StateFactory.PAST_MAXLOAD, Capacity.class); -// prevMaxLoad = (int) stateManager.getActivityState(prevAct, StateFactory.PAST_MAXLOAD).toDouble(); } if(newAct instanceof PickupService || newAct instanceof ServiceActivity){ if(!Capacity.addup(newAct.getSize(), futureMaxLoad).isLessOrEqual(iFacts.getNewVehicle().getType().getCapacityDimensions())){ return ConstraintsStatus.NOT_FULFILLED; } -// if(newAct.getCapacityDemand() + futureMaxLoad > iFacts.getNewVehicle().getCapacity()){ -//// log.debug("insertionOf("+newAct+").BETWEEN("+prevAct+").AND("+nextAct+")=NOT_POSSIBLE"); -// return ConstraintsStatus.NOT_FULFILLED; -// } } if(newAct instanceof DeliverService){ if(!Capacity.addup(Capacity.invert(newAct.getSize()), prevMaxLoad).isLessOrEqual(iFacts.getNewVehicle().getType().getCapacityDimensions())){ return ConstraintsStatus.NOT_FULFILLED_BREAK; } -// if(Math.abs(newAct.getCapacityDemand()) + prevMaxLoad > iFacts.getNewVehicle().getCapacity()){ -//// log.debug("insertionOf("+newAct+").BETWEEN("+prevAct+").AND("+nextAct+")=NOT_POSSIBLE[break=neverBePossibleAnymore]"); -// return ConstraintsStatus.NOT_FULFILLED_BREAK; -// } - } -// log.debug("insertionOf("+newAct+").BETWEEN("+prevAct+").AND("+nextAct+")=POSSIBLE"); return ConstraintsStatus.FULFILLED; } } \ No newline at end of file