View Javadoc
1   package org.opentrafficsim.core.network;
2   
3   import java.util.Set;
4   
5   import nl.tudelft.simulation.dsol.animation.LocatableInterface;
6   
7   import org.opentrafficsim.core.unit.AnglePlaneUnit;
8   import org.opentrafficsim.core.unit.AngleSlopeUnit;
9   import org.opentrafficsim.core.value.vdouble.scalar.DoubleScalar;
10  
11  /**
12   * The Node is a point with an id. It is used in the network to connect Links.
13   * <p>
14   * Copyright (c) 2013-2014 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
15   * BSD-style license. See <a href="http://opentrafficsim.org/node/13">OpenTrafficSim License</a>.
16   * <p>
17   * @version Aug 19, 2014 <br>
18   * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a>
19   * @author <a href="http://www.tudelft.nl/pknoppers">Peter Knoppers</a>
20   * @author <a href="http://www.citg.tudelft.nl">Guus Tamminga</a>
21   * @param <ID> the ID type of the Node.
22   * @param <P> the point type, e.g., com.vividsolutions.jts.geom.Point, DirectedPoint.
23   */
24  public interface Node<ID, P> extends LocatableInterface
25  {
26      /** @return node id. */
27      ID getId();
28  
29      /** @return point. */
30      P getPoint();
31      
32      /** @return the 3D direction. "East" is 0 degrees. "North" is 90 degrees (1/2 pi radians). */
33      DoubleScalar.Abs<AnglePlaneUnit> getDirection();
34  
35      /** @return the slope as an angle. */
36      DoubleScalar.Abs<AngleSlopeUnit> getSlope();
37  
38      /**
39       * Add an incoming link to this Node.
40       * @param linkIn the link to add.
41       */
42      void addLinkIn(Link<?, ? extends Node<ID, P>> linkIn);
43  
44      /**
45       * Add an outgoing link to this Node.
46       * @param linkOut the link to add.
47       */
48      void addLinkOut(final Link<?, ? extends Node<ID, P>> linkOut);
49  
50      /** @return linksIn. */
51      Set<Link<?, ? extends Node<ID, P>>> getLinksIn();
52  
53      /** @return linksOut. */
54      Set<Link<?, ? extends Node<ID, P>>> getLinksOut();
55  }