-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(routing): use graphhopper to provide GTFS based public transport…
… routing
- Loading branch information
Showing
26 changed files
with
17,684 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...-routing/src/main/java/org/eclipse/mosaic/lib/routing/config/CPublicTransportRouting.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright (c) 2024 Fraunhofer FOKUS and others. All rights reserved. | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contact: [email protected] | ||
*/ | ||
|
||
package org.eclipse.mosaic.lib.routing.config; | ||
|
||
public class CPublicTransportRouting { | ||
|
||
public boolean enabled = false; | ||
|
||
public String osmFile = "map.osm"; | ||
public String gtfsFile = "gtfs.zip"; | ||
public String scheduleDateTime = "2024-12-03T10:15:30"; | ||
public String timeZone = "ECT"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
lib/mosaic-routing/src/main/java/org/eclipse/mosaic/lib/routing/pt/MultiModalLeg.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
/* | ||
* Copyright (c) 2024 Fraunhofer FOKUS and others. All rights reserved. | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contact: [email protected] | ||
*/ | ||
|
||
package org.eclipse.mosaic.lib.routing.pt; | ||
|
||
import org.eclipse.mosaic.lib.objects.vehicle.VehicleDeparture; | ||
|
||
public class MultiModalLeg { | ||
|
||
public enum Type { | ||
WALKING, VEHICLE_SHARED, VEHICLE_PRIVATE, PUBLIC_TRANSPORT | ||
} | ||
|
||
private Type legType; | ||
|
||
//For legs where a vehicle needs to be spawned | ||
private VehicleDeparture vehicleLeg = null; | ||
|
||
//For PTlegs | ||
private PtLeg publicTransportationLeg = null; | ||
|
||
private WalkLeg walkLeg = null; | ||
|
||
//For legs where a vehicle already exists | ||
private String carID = null; | ||
|
||
public long departureTime; | ||
public long arrivalTime; | ||
|
||
public MultiModalLeg(VehicleDeparture vehicleLeg, long departureTime, long arrivalTime) { | ||
this.legType = Type.VEHICLE_PRIVATE; | ||
this.vehicleLeg = vehicleLeg; | ||
|
||
this.departureTime = departureTime; | ||
this.arrivalTime = arrivalTime; | ||
} | ||
|
||
public MultiModalLeg(PtLeg ptRoute, long departureTime, long arrivalTime) { | ||
this.legType = Type.PUBLIC_TRANSPORT; | ||
this.publicTransportationLeg = ptRoute; | ||
|
||
this.departureTime = departureTime; | ||
this.arrivalTime = arrivalTime; | ||
} | ||
|
||
public MultiModalLeg(WalkLeg walkLeg, long departureTime, long arrivalTime) { | ||
this.legType = Type.WALKING; | ||
this.walkLeg = walkLeg; | ||
|
||
this.departureTime = departureTime; | ||
this.arrivalTime = arrivalTime; | ||
} | ||
|
||
public MultiModalLeg(String carID, long departureTime, long arrivalTime) { | ||
this.legType = Type.VEHICLE_PRIVATE; | ||
this.carID = carID; | ||
|
||
this.departureTime = departureTime; | ||
this.arrivalTime = arrivalTime; | ||
} | ||
|
||
public Object getLeg() { | ||
return switch (legType) { | ||
case VEHICLE_PRIVATE -> vehicleLeg; | ||
case VEHICLE_SHARED -> carID; | ||
case PUBLIC_TRANSPORT -> publicTransportationLeg; | ||
case WALKING -> walkLeg; | ||
}; | ||
} | ||
|
||
public Type getLegType() { | ||
return legType; | ||
} | ||
} |
Oops, something went wrong.