Codota Logo
ExperimentalTransitRouteFactory
Code IndexAdd Codota to your IDE (free)

How to use
ExperimentalTransitRouteFactory
in
org.matsim.pt.routes

Best Java code snippets using org.matsim.pt.routes.ExperimentalTransitRouteFactory (Showing top 4 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
StringBuilder s =
  • Codota Iconnew StringBuilder()
  • Codota Iconnew StringBuilder(32)
  • Codota IconString str;new StringBuilder(str)
  • Smart code suggestions by Codota
}
origin: matsim-org/matsim

@Override
public Route getRoute(String mode) {
  Route route;
  Id<Link> startLinkId = Id.createLinkId(startLinkIdString);
  Id<Link> endLinkId = Id.createLinkId(endLinkIdString);
  if (mode.equals(TransportMode.pt) && isUseTransit) {
    route = new ExperimentalTransitRouteFactory().createRoute(startLinkId, endLinkId);
  } else {
    route = RouteUtils.createGenericRouteImpl(startLinkId, endLinkId);
  }
  route.setDistance(distance);
  route.setTravelTime(travelTime);
  route.setStartLinkId(startLinkId);
  route.setEndLinkId(endLinkId);
  route.setRouteDescription(routeDescription);
  return route;
}
origin: matsim-org/matsim

public RouteFactories() {
  this.setRouteFactory(NetworkRoute.class, new LinkNetworkRouteFactory());
  this.setRouteFactory(ExperimentalTransitRoute.class, new ExperimentalTransitRouteFactory());
}

origin: matsim-org/matsim

@Override
public void handleEvent(PersonStuckEvent event) {
  Double startWaitingTime = agentsWaitingData.get(event.getPersonId());
  if(startWaitingTime!=null) {
    int legs = 0, currentLeg = agentsCurrentLeg.get(event.getPersonId());
    PLAN_ELEMENTS:
    for(PlanElement planElement:population.getPersons().get(event.getPersonId()).getSelectedPlan().getPlanElements())
      if(planElement instanceof Leg) {
        if(currentLeg==legs) {
          Route route = ((Leg)planElement).getRoute();
          ExperimentalTransitRoute eRoute = (ExperimentalTransitRoute) new ExperimentalTransitRouteFactory().createRoute(route.getStartLinkId(), route.getEndLinkId());
          eRoute.setStartLinkId(route.getStartLinkId());
          eRoute.setEndLinkId(route.getEndLinkId());
          eRoute.setRouteDescription(route.getRouteDescription());
          WaitTimeData data = waitTimes.get(new Tuple<Id<TransitLine>, Id<TransitRoute>>(eRoute.getLineId(), eRoute.getRouteId())).get(eRoute.getAccessStopId());
          if(data!=null)
            data.addWaitTime((int) (startWaitingTime/timeSlot), event.getTime()-startWaitingTime);
          agentsWaitingData.remove(event.getPersonId());
          break PLAN_ELEMENTS;
        }
        else
          legs++;
      }
  }
}
origin: matsim-org/matsim

@Override
public void handleEvent(PersonEntersVehicleEvent event) {
  Double startWaitingTime = agentsWaitingData.get(event.getPersonId());
  if(startWaitingTime!=null) {
    int legs = 0, currentLeg = agentsCurrentLeg.get(event.getPersonId());
    PLAN_ELEMENTS:
    for(PlanElement planElement:population.getPersons().get(event.getPersonId()).getSelectedPlan().getPlanElements())
      if(planElement instanceof Leg) {
        if(currentLeg==legs) {
          Route route = (((Leg)planElement).getRoute());
          ExperimentalTransitRoute eRoute = (ExperimentalTransitRoute) new ExperimentalTransitRouteFactory().createRoute(route.getStartLinkId(), route.getEndLinkId());
          eRoute.setStartLinkId(route.getStartLinkId());
          eRoute.setEndLinkId(route.getEndLinkId());
          eRoute.setRouteDescription(route.getRouteDescription());
          WaitTimeData data = waitTimes.get(new Tuple<Id<TransitLine>, Id<TransitRoute>>(eRoute.getLineId(), eRoute.getRouteId())).get(eRoute.getAccessStopId());
          data.addWaitTime((int) (startWaitingTime/timeSlot), event.getTime()-startWaitingTime);
          agentsWaitingData.remove(event.getPersonId());
          break PLAN_ELEMENTS;
        }
        else
          legs++;
      }
  }
}
 
org.matsim.pt.routesExperimentalTransitRouteFactory

Most used methods

  • <init>
  • createRoute

Popular in Java

  • Making http post requests using okhttp
  • setRequestProperty (URLConnection)
  • putExtra (Intent)
  • requestLocationUpdates (LocationManager)
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
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