Class XmlOdParser
java.lang.Object
org.opentrafficsim.road.network.factory.xml.demand.XmlOdParser
- All Implemented Interfaces:
Serializable
public class XmlOdParser extends Object implements Serializable
OD parser.
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.
- Version:
- $Revision$, $LastChangedDate$, by $Author$, initial version 25 mei 2018
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description XmlOdParser(OTSSimulatorInterface simulator, OTSRoadNetwork network, Set<GTUType> gtuTypes)Constructor. -
Method Summary
Modifier and Type Method Description voidapply(InputStream stream)Applies demand from stream.voidapply(InputStream stream, ODOptions odOptions)Applies demand from stream using OD options.voidapply(URL url)Applies demand from URL.voidapply(URL url, ODOptions odOptions)Applies demand from URL using OD options.voidapply(Node xmlNode)Applies demand from xml node.voidapply(Node xmlNode, ODOptions odOptions)Applies demand from URL using OD options.ODMatrixbuild(InputStream stream)Build demand from stream.ODMatrixbuild(URL url)Build demand from URL.ODMatrixbuild(Node xmlNode)Build demand from xml node.GTUTypegetGTUType(String id)Returns the GTU type for the given id.
-
Constructor Details
-
XmlOdParser
Constructor.- Parameters:
simulator- OTSSimulatorInterface; simulatornetwork- OTSRoadNetwork; networkgtuTypes- Set<GTUType>; set of GTU types
-
-
Method Details
-
getGTUType
Returns the GTU type for the given id.- Parameters:
id- String; id- Returns:
- GTU type for the given id
- Throws:
XmlParserException- if the GTU type is not available
-
apply
Applies demand from URL.- Parameters:
url- URL; URL to file- Throws:
XmlParserException- if URL cannot be parsed
-
apply
Applies demand from URL using OD options.- Parameters:
url- URL; URL to fileodOptions- ODOptions; OD options- Throws:
XmlParserException- if URL cannot be parsed
-
apply
Applies demand from stream.- Parameters:
stream- InputStream; stream- Throws:
XmlParserException- if URL cannot be parsed
-
apply
Applies demand from stream using OD options.- Parameters:
stream- InputStream; streamodOptions- ODOptions; OD options- Throws:
XmlParserException- if URL cannot be parsed
-
apply
Applies demand from xml node.- Parameters:
xmlNode- Node; node- Throws:
XmlParserException- if URL cannot be parsed
-
apply
Applies demand from URL using OD options.- Parameters:
xmlNode- Node; nodeodOptions- ODOptions; OD options- Throws:
XmlParserException- if URL cannot be parsed
-
build
Build demand from URL.- Parameters:
url- URL; URL to file- Returns:
- ODMatrix; OD matrix
- Throws:
XmlParserException- if URL cannot be parsed
-
build
Build demand from stream.- Parameters:
stream- InputStream; stream- Returns:
- ODMatrix; OD matrix
- Throws:
XmlParserException- if stream cannot be parsed
-
build
Build demand from xml node.- Parameters:
xmlNode- Node; node- Returns:
- ODMatrix; OD matrix
- Throws:
XmlParserException- if stream cannot be parsed
-