21 package org.matsim.visum;
23 import java.util.HashMap;
24 import java.util.LinkedHashMap;
26 import java.util.TreeMap;
40 public final Map<Id<Stop>,
Stop>
stops =
new TreeMap<>();
42 public final Map<String, StopPoint>
stopPoints =
new TreeMap<String, StopPoint>();
44 public final Map<String, TransitLineRoute>
lineRoutes =
new TreeMap<String, TransitLineRoute>();
45 public final Map<String, LineRouteItem>
lineRouteItems =
new TreeMap<String, LineRouteItem>();
46 public final Map<String, TimeProfile>
timeProfiles =
new TreeMap<String, TimeProfile>();
47 public final Map<String, TimeProfileItem>
timeProfileItems =
new LinkedHashMap<String, TimeProfileItem>();
48 public final Map<String, Departure>
departures =
new TreeMap<String, Departure>();
49 public final Map<String, Departure>
departuresByNo =
new TreeMap<String, Departure>();
50 public final Map<String, VehicleUnit>
vehicleUnits =
new HashMap<String, VehicleUnit>();
51 public final Map<String, VehicleCombination>
vehicleCombinations =
new HashMap<String, VehicleCombination>();
54 EdgeType oldEdgeType = edgeTypes.put(edgeType.
id, edgeType);
55 if (oldEdgeType != null) {
56 throw new IllegalArgumentException(
"Duplicate edge type.");
61 Stop oldStop = this.stops.put(stop.
id, stop);
62 if (oldStop != null) {
65 this.stops.put(oldStop.
id, oldStop);
66 throw new IllegalArgumentException(
"There is already a stop with the same Name");
72 StopArea oldStopAr = this.stopAreas.put(stopAr.
id, stopAr);
73 if (oldStopAr != null) {
76 this.stopAreas.put(oldStopAr.
id, oldStopAr);
77 throw new IllegalArgumentException(
"There is already a stop area with the same id.");
84 if (oldStopPt != null) {
87 this.stopPoints.put(oldStopPt.
stopAreaId.toString()+oldStopPt.
id.toString(), oldStopPt);
88 throw new IllegalArgumentException(
"There is already a stop with the same id.");
97 this.lines.put(oldl.
id, oldl);
98 throw new IllegalArgumentException(
"There is already a line with the same id.");
107 this.lineRoutes.put(oldlr.
lineName.toString()+
"/"+oldlr.
id.toString()+
"/"+oldlr.
DCode, oldlr);
108 throw new IllegalArgumentException(
"There is already a line route with the same id.");
114 if (oldlri != null) {
118 throw new IllegalArgumentException(
"There is already a route item with the same id."+oldlri.
lineName +
"/"+ oldlri.
lineRouteName +
"/"+oldlri.
index+
"/"+ oldlri.
DCode);
128 throw new IllegalArgumentException(
"There is already a time profile with the same id."+oldtp.
lineRouteName.toString() +
"/"+ oldtp.
index.toString());
134 if (oldtpi != null) {
138 throw new IllegalArgumentException(
"There is already a time profile item with the same id.");
148 throw new IllegalArgumentException(
"There is already a departure with the same id.");
150 this.departuresByNo.put(d.
index, d);
154 VehicleUnit oldVU = this.vehicleUnits.put(vehUnit.
id, vehUnit);
158 this.vehicleUnits.put(oldVU.
id, oldVU);
159 throw new IllegalArgumentException(
"There is already a vehicle unit with the same id.");
168 this.vehicleCombinations.put(oldVC.
id, oldVC);
169 throw new IllegalArgumentException(
"There is already a vehicle combination with the same id.");
206 this.StopId = stopId;
218 this.stopAreaId = stopAreaId;
220 this.refLinkNo = refLinkNo;
221 this.nodeId = nodeId;
233 this.lineName = lineName;
247 this.vehCombNo = vehCombNo;
260 this.lineName = lineName;
261 this.lineRouteName = lineRouteName;
263 this.nodeId = nodeId;
264 this.stopPointNo = stopPointNo;
277 this.lineName = lineName;
278 this.lineRouteName = lineRouteName;
280 this.dirCode = dirCode;
281 this.vehCombNr = vehCombNr;
295 public TimeProfileItem(
final String lineName,
final String lineRouteName,
final String timeProfileName,
final String DCode,
final String index,
final String arr,
final String dep,
final Id<TimeProfileItem> lRIIndex) {
296 this.lineName = lineName;
297 this.lineRouteName = lineRouteName;
298 this.timeProfileName = timeProfileName;
299 this.dirCode = DCode;
303 this.lRIIndex = lRIIndex;
314 public String vehCombinationNo = null;
316 public Departure(
final String lineName,
final String lineRouteName,
final String index,
final String TRI,
final String dep,
final String dirCode) {
317 this.lineName = lineName;
318 this.lineRouteName = lineRouteName;
322 this.dirCode = dirCode;
327 public final String
id;
332 public VehicleUnit(
final String
id,
final String name,
final int seats,
final int passengerCapacity) {
336 this.passengerCapacity = passengerCapacity;
341 public final String
id;
343 public String vehUnitId = null;
344 public int numOfVehicles = 0;
final Id< Link > refLinkNo
Stop(final Id< Stop > id, final String name, final Coord coord)
void addLineRoute(final TransitLineRoute lr1)
final Map< Id< StopArea >, StopArea > stopAreas
void addStop(final Stop stop)
void addStopArea(final StopArea stopAr)
void addEdgeType(final EdgeType edgeType)
VehicleCombination(final String id, final String name)
void addline(final TransitLine l1)
final Map< String, Departure > departures
final int passengerCapacity
final Map< String, TimeProfileItem > timeProfileItems
final Map< String, StopPoint > stopPoints
TimeProfileItem(final String lineName, final String lineRouteName, final String timeProfileName, final String DCode, final String index, final String arr, final String dep, final Id< TimeProfileItem > lRIIndex)
final Id< TransitLine > lineName
Departure(final String lineName, final String lineRouteName, final String index, final String TRI, final String dep, final String dirCode)
final Id< StopPoint > stopPointNo
final Id< StopArea > stopAreaId
final Id< TransitLine > lineName
final Id< TimeProfileItem > lRIIndex
void addStopPoint(final StopPoint stopPt)
void addVehicleCombination(final VehicleCombination vehComb)
EdgeType(Id< EdgeType > id, String kapIV, String v0IV, String noOfLanes)
void addTimeProfile(final TimeProfile tp1)
final String lineRouteName
TransitLineRoute(final Id< TransitLineRoute > id, final Id< TransitLine > lineName, final String DCode)
final Map< String, Departure > departuresByNo
final Id< TransitLineRoute > id
final Map< String, VehicleUnit > vehicleUnits
StopArea(final Id< StopArea > id, final Id< Stop > stopId)
final Map< Id< EdgeType >, EdgeType > edgeTypes
StopPoint(final Id< StopPoint > id, final Id< StopArea > stopAreaId, final String name, final Id< Link > refLinkNo, final Id< Node > nodeId)
final Map< Id< Stop >, Stop > stops
VehicleUnit(final String id, final String name, final int seats, final int passengerCapacity)
final Id< TimeProfile > index
final Id< TransitLineRoute > lineRouteName
LineRouteItem(final String lineName, final String lineRouteName, final String index, final String DCode, final Id< Node > nodeId, final Id< StopPoint > stopPointNo)
final Map< String, VehicleCombination > vehicleCombinations
final Map< Id< TransitLine >, TransitLine > lines
TimeProfile(final Id< TransitLine > lineName, final Id< TransitLineRoute > lineRouteName, final Id< TimeProfile > index, final String dirCode, final String vehCombNr)
TransitLine(final Id< TransitLine > id, final String tCode, final String vehCombNo)
final Map< String, TransitLineRoute > lineRoutes
void addLineRouteItem(final LineRouteItem lri1)
void addTimeProfileItem(final TimeProfileItem tpi1)
final String lineRouteName
final Map< String, TimeProfile > timeProfiles
final Id< TransitLine > id
final String timeProfileName
void addDeparture(final Departure d)
void addVehicleUnit(final VehicleUnit vehUnit)
final String lineRouteName
final Map< String, LineRouteItem > lineRouteItems