private String getToNodeId(Shipment shipment) { return shipment.getId() + "_delivery"; }
private String getFromNodeId(Shipment shipment) { return shipment.getId() + "_pickup"; }
private void addShipment(Shipment job) { if (jobs.containsKey(job.getId())) { logger.warn("The job " + job + " has already been added to the job list. This overrides the existing job."); } addLocationToTentativeLocations(job); // tentative_coordinates.put(job.getPickupLocation().getId(), job.getPickupLocation().getCoordinate()); // tentative_coordinates.put(job.getDeliveryLocation().getId(), job.getDeliveryLocation().getCoordinate()); jobs.put(job.getId(), job); }
private void addJobsAndTheirLocationsToVrp() { for (Service service : serviceMap.values()) { if (!freezedJobIds.contains(service.getId())) { vrpBuilder.addJob(service); } } for (Shipment shipment : shipmentMap.values()) { if (!freezedJobIds.contains(shipment.getId())) { vrpBuilder.addJob(shipment); } } }
private void renderShipment(Graph g, Shipment shipment, Label label, boolean renderShipments) { Node n1 = g.addNode(makeId(shipment.getId(), shipment.getPickupLocation().getId())); if (label.equals(Label.ID)) n1.addAttribute("ui.label", shipment.getId()); n1.addAttribute("x", shipment.getPickupLocation().getCoordinate().getX()); n1.addAttribute("y", shipment.getPickupLocation().getCoordinate().getY()); n1.setAttribute("ui.class", "pickup"); Node n2 = g.addNode(makeId(shipment.getId(), shipment.getDeliveryLocation().getId())); if (label.equals(Label.ID)) n2.addAttribute("ui.label", shipment.getId()); n2.addAttribute("x", shipment.getDeliveryLocation().getCoordinate().getX()); n2.addAttribute("y", shipment.getDeliveryLocation().getCoordinate().getY()); n2.setAttribute("ui.class", "delivery"); if (renderShipments) { Edge s = g.addEdge(shipment.getId(), makeId(shipment.getId(), shipment.getPickupLocation().getId()), makeId(shipment.getId(), shipment.getDeliveryLocation().getId()), true); s.addAttribute("ui.class", "shipment"); } }
private String getFromNodeId(Shipment shipment) { return shipment.getId() + "_pickup"; }
private String getToNodeId(Shipment shipment) { return shipment.getId() + "_delivery"; }
shipmentMap.put(shipment.getId(), shipment);
private void addShipment(Shipment job) { if (jobs.containsKey(job.getId())) { logger.warn("job " + job + " already in job list. overrides existing job."); } addLocationToTentativeLocations(job); // tentative_coordinates.put(job.getPickupLocation().getId(), job.getPickupLocation().getCoordinate()); // tentative_coordinates.put(job.getDeliveryLocation().getId(), job.getDeliveryLocation().getCoordinate()); jobs.put(job.getId(), job); }
private void addJobsAndTheirLocationsToVrp() { for (Service service : serviceMap.values()) { if (!freezedJobIds.contains(service.getId())) { vrpBuilder.addJob(service); } } for (Shipment shipment : shipmentMap.values()) { if (!freezedJobIds.contains(shipment.getId())) { vrpBuilder.addJob(shipment); } } }
if (!(j instanceof Shipment)) continue; Shipment shipment = (Shipment) j; xmlConfig.setProperty(shipmentPathString + "(" + counter + ")[@id]", shipment.getId());
private void renderShipment(Graph g, Shipment shipment, Label label, boolean renderShipments) { Node n1 = g.addNode(makeId(shipment.getId(), shipment.getPickupLocation().getId())); if (label.equals(Label.ID)) n1.addAttribute("ui.label", shipment.getId()); n1.addAttribute("x", shipment.getPickupLocation().getCoordinate().getX()); n1.addAttribute("y", shipment.getPickupLocation().getCoordinate().getY()); n1.setAttribute("ui.class", "pickup"); Node n2 = g.addNode(makeId(shipment.getId(), shipment.getDeliveryLocation().getId())); if (label.equals(Label.ID)) n2.addAttribute("ui.label", shipment.getId()); n2.addAttribute("x", shipment.getDeliveryLocation().getCoordinate().getX()); n2.addAttribute("y", shipment.getDeliveryLocation().getCoordinate().getY()); n2.setAttribute("ui.class", "delivery"); if (renderShipments) { Edge s = g.addEdge(shipment.getId(), makeId(shipment.getId(), shipment.getPickupLocation().getId()), makeId(shipment.getId(), shipment.getDeliveryLocation().getId()), true); s.addAttribute("ui.class", "shipment"); } }
shipmentMap.put(shipment.getId(), shipment);
/** * Creates (MATSim) {@link CarrierShipment} from a (jsprit) {@link Shipment} * * @param shipment to be transformed to MATSim * @return CarrierShipment * @see CarrierShipment, Shipment */ static CarrierShipment createCarrierShipment(Shipment shipment) { return CarrierShipment.Builder.newInstance(Id.create(shipment.getId(), CarrierShipment.class), Id.createLinkId(shipment.getPickupLocation().getId()), Id.createLinkId(shipment.getDeliveryLocation().getId()), shipment.getSize().get(0)) .setDeliveryServiceTime(shipment.getDeliveryServiceTime()) .setDeliveryTimeWindow(TimeWindow.newInstance(shipment.getDeliveryTimeWindow().getStart(), shipment.getDeliveryTimeWindow().getEnd())) .setPickupServiceTime(shipment.getPickupServiceTime()) .setPickupTimeWindow(TimeWindow.newInstance(shipment.getPickupTimeWindow().getStart(), shipment.getPickupTimeWindow().getEnd())) .build(); }
if (!(j instanceof Shipment)) continue; Shipment shipment = (Shipment) j; xmlConfig.setProperty(shipmentPathString + "(" + counter + ")[@id]", shipment.getId());