View Javadoc
1   package org.opentrafficsim.road.gtu.generator.od;
2   
3   import org.opentrafficsim.core.gtu.GTUException;
4   import org.opentrafficsim.core.network.Node;
5   import org.opentrafficsim.road.gtu.lane.tactical.following.IDMPlusFactory;
6   import org.opentrafficsim.road.gtu.lane.tactical.lmrs.DefaultLMRSPerceptionFactory;
7   import org.opentrafficsim.road.gtu.lane.tactical.lmrs.LMRSFactory;
8   import org.opentrafficsim.road.gtu.strategical.LaneBasedStrategicalPlannerFactory;
9   import org.opentrafficsim.road.gtu.strategical.od.Category;
10  import org.opentrafficsim.road.gtu.strategical.route.LaneBasedStrategicalRoutePlannerFactory;
11  import org.opentrafficsim.road.gtu.strategical.route.RouteSupplier;
12  
13  import nl.tudelft.simulation.jstats.streams.StreamInterface;
14  
15  /**
16   * Supplies a strategical planner factories within DefaultGTUCharacteristicsGeneratorOD.
17   * <p>
18   * Copyright (c) 2013-2018 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
19   * BSD-style license. See <a href="http://opentrafficsim.org/node/13">OpenTrafficSim License</a>.
20   * <p>
21   * @version $Revision$, $LastChangedDate$, by $Author$, initial version 26 mrt. 2018 <br>
22   * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a>
23   * @author <a href="http://www.tudelft.nl/pknoppers">Peter Knoppers</a>
24   * @author <a href="http://www.transport.citg.tudelft.nl">Wouter Schakel</a>
25   */
26  public interface StrategicalPlannerFactorySupplierOD
27  {
28      /** Default LMRS model. */
29      StrategicalPlannerFactorySupplierOD LMRS = new StrategicalPlannerFactorySupplierOD()
30      {
31          @Override
32          public LaneBasedStrategicalPlannerFactory<?> getFactory(final Node origin, final Node destination,
33                  final Category category, final StreamInterface randomStream) throws GTUException
34          {
35              return new LaneBasedStrategicalRoutePlannerFactory(
36                      new LMRSFactory(new IDMPlusFactory(randomStream), new DefaultLMRSPerceptionFactory()),
37                      RouteSupplier.getDefaultRouteSupplier(randomStream));
38          }
39      };
40  
41      /**
42       * Supplies a strategical factory.
43       * @param origin Node; origin
44       * @param destination Node; destination
45       * @param category Category; category (GTU type, route, or more)
46       * @param randomStream StreamInterface; stream for random numbers
47       * @return LaneBasedGTUCharacteristics
48       * @throws GTUException if characteristics could not be generated for the GTUException
49       */
50      LaneBasedStrategicalPlannerFactory<?> getFactory(Node origin, Node destination, Category category,
51              StreamInterface randomStream) throws GTUException;
52  
53  }