View Javadoc
1   package org.opentrafficsim.core.network.lane;
2   
3   import java.util.HashSet;
4   import java.util.Set;
5   
6   import org.opentrafficsim.core.gtu.generator.GTUGeneratorIndividual;
7   import org.opentrafficsim.core.network.LongitudinalDirectionality;
8   import org.opentrafficsim.core.network.NetworkException;
9   import org.opentrafficsim.core.unit.FrequencyUnit;
10  import org.opentrafficsim.core.unit.LengthUnit;
11  import org.opentrafficsim.core.value.vdouble.scalar.DoubleScalar;
12  
13  /**
14   * Lane that creates GTUs.
15   * <p>
16   * Copyright (c) 2013-2014 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
17   * BSD-style license. See <a href="http://opentrafficsim.org/node/13">OpenTrafficSim License</a>.
18   * <p>
19   * @version Jan 30, 2015 <br>
20   * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a>
21   * @author <a href="http://www.tudelft.nl/pknoppers">Peter Knoppers</a>
22   */
23  public class SourceLane extends Lane
24  {
25      /** the generators on this generation lane; one per GTU type. */
26      private final Set<GTUGeneratorIndividual<?>> generators = new HashSet<GTUGeneratorIndividual<?>>();
27      
28      /**
29       * Construct a GeneratorLane.
30       * @param parentLink Cross Section Link to which the element belongs.
31       * @param lateralOffsetAtStart DoubleScalar.Rel&lt;LengthUnit&gt;; the lateral offset of the design line of the new
32       *            CrossSectionLink with respect to the design line of the parent Link at the start of the parent Link
33       * @param beginWidth DoubleScalar.Rel&lt;LengthUnit&gt;; start width, positioned <i>symmetrically around</i> the design line
34       * @param laneType type of lane to deduce compatibility with GTU types
35       * @param directionality in direction of geometry, reverse, or both
36       * @throws NetworkException when creation of the geometry fails
37       */
38      @SuppressWarnings("checkstyle:parameternumber")
39      public SourceLane(final CrossSectionLink<?, ?> parentLink, final DoubleScalar.Rel<LengthUnit> lateralOffsetAtStart,
40          final DoubleScalar.Rel<LengthUnit> beginWidth, final LaneType<?> laneType,
41          final LongitudinalDirectionality directionality) throws NetworkException
42      {
43          super(parentLink, lateralOffsetAtStart, lateralOffsetAtStart, beginWidth, beginWidth, laneType, directionality,
44              new DoubleScalar.Abs<FrequencyUnit>(1, FrequencyUnit.SI));
45      }
46  
47  
48  }