1
0
Fork 0
mirror of https://github.com/graphhopper/jsprit.git synced 2020-01-24 07:45:05 +01:00

Merge branch 'routes-with-specified-start-and-end' into

access-egress-costs-merged-with-routes-with-spec-start-end

Conflicts:
	jsprit-core/src/test/java/jsprit/core/algorithm/recreate/TestCalculatesServiceInsertion.java
	jsprit-examples/src/main/java/jsprit/examples/MultipleDepotExampleWithPenaltyVehicles.java
	jsprit-examples/src/main/java/jsprit/examples/SolomonExample.java
	jsprit-examples/src/main/java/jsprit/examples/SolomonOpenExample.java
This commit is contained in:
oblonski 2014-02-11 05:39:06 +01:00
commit 6dbcd7431a
75 changed files with 4281 additions and 525 deletions

View file

@ -384,17 +384,27 @@ public class GraphStreamViewer {
}
private void renderVehicle(Graph g, Vehicle vehicle, Label label) {
Node n = g.addNode(makeId(vehicle.getId(),vehicle.getLocationId()));
if(label.equals(Label.ID)) n.addAttribute("ui.label", "depot");
Node vehicleStart = g.addNode(makeId(vehicle.getId(),vehicle.getStartLocationId()));
if(label.equals(Label.ID)) vehicleStart.addAttribute("ui.label", "depot");
// if(label.equals(Label.ACTIVITY)) n.addAttribute("ui.label", "start");
n.addAttribute("x", vehicle.getCoord().getX());
n.addAttribute("y", vehicle.getCoord().getY());
n.setAttribute("ui.class", "depot");
vehicleStart.addAttribute("x", vehicle.getStartLocationCoordinate().getX());
vehicleStart.addAttribute("y", vehicle.getStartLocationCoordinate().getY());
vehicleStart.setAttribute("ui.class", "depot");
if(!vehicle.getStartLocationId().equals(vehicle.getEndLocationId())){
Node vehicleEnd = g.addNode(makeId(vehicle.getId(),vehicle.getEndLocationId()));
if(label.equals(Label.ID)) vehicleEnd.addAttribute("ui.label", "depot");
// if(label.equals(Label.ACTIVITY)) n.addAttribute("ui.label", "start");
vehicleEnd.addAttribute("x", vehicle.getEndLocationCoordinate().getX());
vehicleEnd.addAttribute("y", vehicle.getEndLocationCoordinate().getY());
vehicleEnd.setAttribute("ui.class", "depot");
}
}
private void renderRoute(Graph g, VehicleRoute route, int routeId, long renderDelay_in_ms, Label label) {
int vehicle_edgeId = 1;
String prevIdentifier = makeId(route.getVehicle().getId(),route.getVehicle().getLocationId());
String prevIdentifier = makeId(route.getVehicle().getId(),route.getVehicle().getStartLocationId());
if(label.equals(Label.ACTIVITY)){
Node n = g.getNode(prevIdentifier);
n.addAttribute("ui.label", "start");
@ -413,7 +423,7 @@ public class GraphStreamViewer {
sleep(renderDelay_in_ms);
}
if(route.getVehicle().isReturnToDepot()){
String lastIdentifier = makeId(route.getVehicle().getId(),route.getVehicle().getLocationId());
String lastIdentifier = makeId(route.getVehicle().getId(),route.getVehicle().getEndLocationId());
g.addEdge(makeEdgeId(routeId,vehicle_edgeId), prevIdentifier, lastIdentifier, true);
}
}