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.DefaultWeightedEdgeThe LinkEdge is a class that embeds a Link (extension of AbstractLink) to be put in a graph. Typical code to add a link calledlinkwith nodesnodeAandnodeBto 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.
$LastChangedDate: 2020-04-01 12:03:44 +0200 (Wed, 01 Apr 2020) $, @version $Revision: 6424 $, by $Author: pknoppers $, initial version Sep 12, 2014
BSD-style license. See OpenTrafficSim License.- Author:
- Alexander Verbraeck
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectclone()LINKgetLink()StringtoString()
-
-
-
Constructor Detail
-
LinkEdge
public LinkEdge(LINK link)
- Parameters:
link- LINK; the edge to take into the graph.
-
-