MATSIM
RouteSegment.java
Go to the documentation of this file.
1 /* *********************************************************************** *
2  * project: org.matsim.*
3  * *
4  * *********************************************************************** *
5  * *
6  * copyright : (C) 2015 by the members listed in the COPYING, *
7  * LICENSE and WARRANTY file. *
8  * email : info at matsim dot org *
9  * *
10  * *********************************************************************** *
11  * *
12  * This program is free software; you can redistribute it and/or modify *
13  * it under the terms of the GNU General Public License as published by *
14  * the Free Software Foundation; either version 2 of the License, or *
15  * (at your option) any later version. *
16  * See also COPYING, LICENSE and WARRANTY file *
17  * *
18  * *********************************************************************** */
19 
20 package org.matsim.pt.router;
21 
22 import org.matsim.api.core.v01.Id;
26 
32 public class RouteSegment {
33 
34  final TransitStopFacility fromStop;
35  final TransitStopFacility toStop;
36  final double travelTime;
37  final Id<TransitLine> lineTaken;
38  final Id<TransitRoute> routeTaken;
39 
40  public RouteSegment(TransitStopFacility fromStop, TransitStopFacility toStop, double travelTime, Id<TransitLine> lineTaken, Id<TransitRoute> routeTaken) {
41  this.fromStop = fromStop;
42  this.toStop = toStop;
43  this.travelTime = travelTime;
44  this.lineTaken = lineTaken;
45  this.routeTaken = routeTaken;
46  }
47 
48  @Override
49  public String toString() {
50  return "From: " + fromStop.getId() + " to " + toStop.getId() + " in " + travelTime + "s via " + routeTaken;
51  }
52 
53  public double getTravelTime() {
54  return travelTime;
55  }
56 
58  return fromStop;
59  }
60 
62  return toStop;
63  }
64 
66  return lineTaken;
67  }
68 
70  return routeTaken;
71  }
72 }
73 
TransitStopFacility getFromStop()
Id< TransitRoute > getRouteTaken()
Id< TransitLine > getLineTaken()
TransitStopFacility getToStop()
RouteSegment(TransitStopFacility fromStop, TransitStopFacility toStop, double travelTime, Id< TransitLine > lineTaken, Id< TransitRoute > routeTaken)