Codota Logo
TransitRouterNetworkTravelTimeAndDisutility.getLinkTravelTime
Code IndexAdd Codota to your IDE (free)

How to use
getLinkTravelTime
method
in
org.matsim.pt.router.TransitRouterNetworkTravelTimeAndDisutility

Best Java code snippets using org.matsim.pt.router.TransitRouterNetworkTravelTimeAndDisutility.getLinkTravelTime (Showing top 9 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Point p =
  • Codota Iconnew Point(x, y)
  • Codota Iconnew Point()
  • Codota IconMouseEvent e;e.getPoint()
  • Smart code suggestions by Codota
}
origin: matsim-org/matsim

  final Person person, final Vehicle vehicle) {
double cost;
double transfertime = getLinkTravelTime(link, time, person, vehicle);
double waittime = this.config.getAdditionalTransferTime();
origin: matsim-org/matsim

@Override
public double getLinkTravelDisutility(final Link link, final double time, final Person person, final Vehicle vehicle, final CustomDataManager dataManager) {
  double cost;
  if (((TransitRouterNetworkLink) link).getRoute() == null) {
    // "route" here means "pt route".  If no pt route is attached, it means that it is a transfer link.
    cost = defaultTransferCost(link, time, person, vehicle);
    
  } else {
    double offVehWaitTime = offVehicleWaitTime(link, time);		
    double inVehTime = getLinkTravelTime(link,time, person, vehicle) - offVehWaitTime;		
    cost = - inVehTime       * this.config.getMarginalUtilityOfTravelTimePt_utl_s() 
        -offVehWaitTime   * this.config.getMarginalUtilityOfWaitingPt_utl_s()
        -link.getLength() * this.config.getMarginalUtilityOfTravelDistancePt_utl_m();
  }
  return cost;
}

origin: matsim-org/matsim

public void testWaitingTime() {
  Fixture f = new Fixture();
  f.init();
  TransitRouterConfig conf = new TransitRouterConfig(f.scenario.getConfig().planCalcScore(),
      f.scenario.getConfig().plansCalcRoute(), f.scenario.getConfig().transitRouter(),
      f.scenario.getConfig().vspExperimental());
  TransitRouterNetworkTravelTimeAndDisutility tc = new TransitRouterNetworkTravelTimeAndDisutility(conf);
  TransitRouterImpl router = new TransitRouterImpl(conf, f.schedule);
  TransitRouterNetwork routerNet = router.getTransitRouterNetwork();
  // find the link connecting C and D on the blue line
  TransitRouterNetworkLink testLink = null;
  for (TransitRouterNetworkLink link : routerNet.getLinks().values()) {
    if ((link.getLine() == f.blueLine) &&
        (link.fromNode.stop.getStopFacility().getName().equals("C")) &&
        (link.toNode.stop.getStopFacility().getName().equals("D"))) {
      testLink = link;
    }
  }
  assertEquals(2.0*60 + 7.0*60, tc.getLinkTravelTime(testLink, 6.0*3600, null, null), MatsimTestCase.EPSILON);
  assertEquals(1.0*60 + 7.0*60, tc.getLinkTravelTime(testLink, 6.0*3600 + 60, null, null), MatsimTestCase.EPSILON);
  assertEquals(0.0*60 + 7.0*60, tc.getLinkTravelTime(testLink, 6.0*3600 + 120, null, null), MatsimTestCase.EPSILON);
  assertEquals(20.0*60 -1 + 7.0*60, tc.getLinkTravelTime(testLink, 6.0*3600 + 121, null, null), MatsimTestCase.EPSILON);
}
origin: matsim-org/matsim

public void testTravelTimeAfterMidnight() {
  Fixture f = new Fixture();
  f.init();
  TransitRouterConfig conf = new TransitRouterConfig(f.scenario.getConfig().planCalcScore(),
      f.scenario.getConfig().plansCalcRoute(), f.scenario.getConfig().transitRouter(),
      f.scenario.getConfig().vspExperimental());
  TransitRouterNetworkTravelTimeAndDisutility tc = new TransitRouterNetworkTravelTimeAndDisutility(conf);
  TransitRouterImpl router = new TransitRouterImpl(conf, f.schedule);
  TransitRouterNetwork routerNet = router.getTransitRouterNetwork();
  // find the link connecting C and D on the blue line
  TransitRouterNetworkLink testLink = null;
  for (TransitRouterNetworkLink link : routerNet.getLinks().values()) {
    if ((link.getLine() == f.blueLine) &&
        (link.fromNode.stop.getStopFacility().getName().equals("C")) &&
        (link.toNode.stop.getStopFacility().getName().equals("D"))) {
      testLink = link;
    }
  }
  // planned departure at 25:00, has to wait until 05:22 = 29:22
  assertEquals(22.0*60 + 4.0*3600 + 7.0*60, tc.getLinkTravelTime(testLink, 25.0*3600, null, null), MatsimTestCase.EPSILON);
  // planned departure at 47:00, has to wait until 05:22 = 53:22
  assertEquals(22.0*60 + 6.0*3600 + 7.0*60, tc.getLinkTravelTime(testLink, 47.0*3600, null, null), MatsimTestCase.EPSILON);
  // planned departure at 49:00, has to wait until 05:22 = 53:22, tests explicitly > 2*MIDNIGHT
  assertEquals(22.0*60 + 4.0*3600 + 7.0*60, tc.getLinkTravelTime(testLink, 49.0*3600, null, null), MatsimTestCase.EPSILON);
}
origin: matsim-org/matsim

if(l.route!=null) {
  double ttime = ttCalculator.getLinkTravelTime(l, time, person, null);
  travelTime += ttime;
  time += ttime;
origin: matsim-org/matsim

assertEquals(22.0*60 + 4.0*3600 + 7.0*60, tc.getLinkTravelTime(testLink, 25.0*3600, null, null ), MatsimTestCase.EPSILON);
assertEquals(22.0*60 + 6.0*3600 + 7.0*60, tc.getLinkTravelTime(testLink, 47.0*3600, null, null), MatsimTestCase.EPSILON);
assertEquals(22.0*60 + 4.0*3600 + 7.0*60, tc.getLinkTravelTime(testLink, 49.0*3600, null, null), MatsimTestCase.EPSILON);
origin: matsim-org/matsim

public void testTravelTime() {
  Fixture f = new Fixture();
  f.init();
  TransitRouterConfig conf = new TransitRouterConfig(f.scenario.getConfig().planCalcScore(),
      f.scenario.getConfig().plansCalcRoute(), f.scenario.getConfig().transitRouter(),
      f.scenario.getConfig().vspExperimental());
  TransitRouterNetworkTravelTimeAndDisutility tc = new TransitRouterNetworkTravelTimeAndDisutility(conf);
  TransitRouterImpl router = new TransitRouterImpl(conf, f.schedule);
  TransitRouterNetwork routerNet = router.getTransitRouterNetwork();
  // find the link connecting C and G on the red line
  TransitRouterNetworkLink testLink = null;
  for (TransitRouterNetworkLink link : routerNet.getLinks().values()) {
    if ((link.getLine() == f.redLine) &&
        (link.fromNode.stop.getStopFacility().getName().equals("C")) &&
        (link.toNode.stop.getStopFacility().getName().equals("G"))) {
      testLink = link;
    }
  }
  assertEquals(9.0*60, tc.getLinkTravelTime(testLink, 6.0*3600, null, null), MatsimTestCase.EPSILON);
}
origin: matsim-org/matsim

public void testTravelTime() {
  //create the scenario test
  Fixture f = new Fixture();
  f.init();
  
  //create the adapted router
  TransitRouterConfig conf = new TransitRouterConfig(f.scenario.getConfig().planCalcScore(),
      f.scenario.getConfig().plansCalcRoute(), f.scenario.getConfig().transitRouter(),
      f.scenario.getConfig().vspExperimental());
  TransitRouterNetworkTravelTimeAndDisutility tc = new TransitRouterNetworkTravelTimeAndDisutility(conf);
  TransitRouterImpl router = new TransitRouterImpl(conf, f.schedule) ;
  TransitRouterNetwork routerNet = router.getTransitRouterNetwork();
  // find the link connecting C and G on the red line
  TransitRouterNetworkLink testLink = null;
  for (TransitRouterNetworkLink link : routerNet.getLinks().values()) {
    if ((link.getLine() == f.redLine) &&
        (link.fromNode.stop.getStopFacility().getName().equals("C")) &&
        (link.toNode.stop.getStopFacility().getName().equals("G"))) {
      testLink = link;
    }
  }
  //at 6:00 the link travel time = 540
  assertEquals(9.0*60, tc.getLinkTravelTime(testLink, 6.0*3600, null, null), MatsimTestCase.EPSILON);
}
origin: matsim-org/matsim

assertEquals(9.0*60 , tc.getLinkTravelTime(testLink, 6.0*3600, null, null) , MatsimTestCase.EPSILON);
assertEquals(9.0*60+1 , tc.getLinkTravelTime(testLink, 6.0*3600-1, null, null) , MatsimTestCase.EPSILON);
org.matsim.pt.routerTransitRouterNetworkTravelTimeAndDisutilitygetLinkTravelTime

Popular methods of TransitRouterNetworkTravelTimeAndDisutility

  • getWalkTravelTime
  • <init>
  • getVehArrivalTime
  • getWalkTravelDisutility
  • defaultTransferCost
    convenience method for derived classes in order to bring Manuel's version closer to this one here. k
  • getLinkTravelDisutility
  • offVehicleWaitTime
    method to allow inclusion of offVehicleWaitTime without code replication. kai, oct'12

Popular in Java

  • Start an intent from android
  • getSupportFragmentManager (FragmentActivity)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • FileOutputStream (java.io)
    A file output stream is an output stream for writing data to aFile or to a FileDescriptor. Whether
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • PriorityQueue (java.util)
    An unbounded priority Queue based on a priority heap. The elements of the priority queue are ordered
  • DataSource (javax.sql)
    A factory for connections to the physical data source that this DataSource object represents. An alt
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now