Hi,
I am running
Li-Lim benchmark instance lc101. I read the input file using
LiLimReader and use the same config file as
here. The result is good (the same as
here), and the running time is around 5~6 seconds for 10,000 iterations.
However, if I add a setId() for each Location.Builder.newInstance() in
LiLimReader, i.e.,
VehicleImpl vehicle = VehicleImpl.Builder.newInstance("vehicle")
.setEarliestStart(depotOpeningTime).setLatestArrival(depotClosingTime)
.setStartLocation(Location.Builder.newInstance().setId("v0").setCoordinate(customers.get(depotId).coord).build()).setType(type).build();
Shipment s = Shipment.Builder.newInstance(counter.toString()).addSizeDimension(0, demand)
.setPickupLocation(Location.Builder.newInstance().setId("p" + counter).setCoordinate(customers.get(from).coord).build()).setPickupServiceTime(customers.get(from).serviceTime)
.setPickupTimeWindow(TimeWindow.newInstance(customers.get(from).start, customers.get(from).end))
.setDeliveryLocation(Location.Builder.newInstance().setId("d" + counter).setCoordinate(customers.get(to).coord).build()).setDeliveryServiceTime(customers.get(to).serviceTime)
.setDeliveryTimeWindow(TimeWindow.newInstance(customers.get(to).start, customers.get(to).end)).build();
The result is still the same, but the running time increases to 60~70 seconds, even though the IDs of the locations are never used.
In summary, when I include setId() for each Location.Builder.newInstance(), the running time increases significantly. But why?
Thank you.
Best regards,
He