Package org.opentrafficsim.core.network
Class LinkEdge<LINK extends Link>
- java.lang.Object
-
- org.jgrapht.graph.DefaultWeightedEdge
-
- org.opentrafficsim.core.network.LinkEdge<LINK>
-
- Type Parameters:
LINK
- the link type.
- All Implemented Interfaces:
Serializable
,Cloneable
public class LinkEdge<LINK extends Link> extends org.jgrapht.graph.DefaultWeightedEdge
The LinkEdge is a class that embeds a Link (extension of AbstractLink) to be put in a graph. Typical code to add a link calledlink
with nodesnodeA
andnodeB
to a graph is:SimpleWeightedGraph<Node, LinkEdge> linkGraph = new SimpleWeightedGraph<>(LinkEdge.class); ... Link link = new Link(nodeA, nodeB, name); LinkEdge linkEdge = new LinkEdge(link); linkGraph.addEdge(nodeA, nodeB, linkEdge); linkGraph.setEdgeWeight(linkEdge, link.getLength().doubleValue());
Copyright (c) 2013-2022 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.$LastChangedDate$, @version $Revision$, by $Author$, initial version Sep 12, 2014
- Author:
- Alexander Verbraeck
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
clone()
LINK
getLink()
String
toString()
-
-
-
Constructor Detail
-
LinkEdge
public LinkEdge(LINK link)
- Parameters:
link
- LINK; the edge to take into the graph.
-
-