Hi everyone,
I am trying to add a hard constraint such that a pickup is performed only if the vehicle’s start location and pickup’s location are the same. In short, every vehicle performs pickups only from its start location. I added a hard constraint as shown in the code.
public ConstraintsStatus fulfilled(JobInsertionContext iFacts, TourActivity prevAct, TourActivity newAct, TourActivity nextAct, double prevActDepTime) {
if(newAct instanceof PickupShipment) {
if (newAct.getLocation().getId().equals(iFacts.getNewVehicle().getStartLocation().getId()))
return HardActivityConstraint.ConstraintsStatus.FULFILLED;
else
return HardActivityConstraint.ConstraintsStatus.NOT_FULFILLED;
}
return HardActivityConstraint.ConstraintsStatus.FULFILLED;
}
This somehow does not take the constraint into consideration. Can I know what could be the reason?
Thanks in advance