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 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
called
link with nodes nodeA and nodeB 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-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
$LastChangedDate: 2020-01-23 11:14:19 +0100 (Thu, 23 Jan 2020) $, @version $Revision: 6010 $, by $Author: averbraeck $,
initial version Sep 12, 2014
- Author:
- Alexander Verbraeck
- See Also:
- Serialized Form