public class XmlOdParser extends Object implements Serializable
Copyright (c) 2013-2017 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
| Modifier and Type | Field and Description |
|---|---|
(package private) Map<String,CategoryTag> |
categories
Categories.
|
(package private) org.opentrafficsim.road.gtu.strategical.od.Categorization |
categorization
Categorization.
|
(package private) org.opentrafficsim.core.gtu.NestedCache<Set<DemandTag>> |
demand
Demand.
|
(package private) org.opentrafficsim.road.gtu.strategical.od.Interpolation |
globalInterpolation
Global interpolation.
|
(package private) org.djunits.value.vdouble.vector.TimeVector |
globalTime
Global time vector.
|
(package private) org.opentrafficsim.core.network.OTSNetwork |
network
Network.
|
| Constructor and Description |
|---|
XmlOdParser(org.opentrafficsim.core.dsol.OTSDEVSSimulatorInterface simulator,
org.opentrafficsim.core.network.OTSNetwork network,
Set<org.opentrafficsim.core.gtu.GTUType> gtuTypes)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
apply(InputStream stream)
Applies demand from stream.
|
void |
apply(InputStream stream,
org.opentrafficsim.road.gtu.generator.od.ODOptions odOptions)
Applies demand from stream using OD options.
|
void |
apply(Node xmlNode)
Applies demand from xml node.
|
void |
apply(Node xmlNode,
org.opentrafficsim.road.gtu.generator.od.ODOptions odOptions)
Applies demand from URL using OD options.
|
void |
apply(URL url)
Applies demand from URL.
|
void |
apply(URL url,
org.opentrafficsim.road.gtu.generator.od.ODOptions odOptions)
Applies demand from URL using OD options.
|
org.opentrafficsim.road.gtu.strategical.od.ODMatrix |
build(InputStream stream)
Build demand from stream.
|
org.opentrafficsim.road.gtu.strategical.od.ODMatrix |
build(Node xmlNode)
Build demand from xml node.
|
org.opentrafficsim.road.gtu.strategical.od.ODMatrix |
build(URL url)
Build demand from URL.
|
org.opentrafficsim.core.gtu.GTUType |
getGTUType(String id)
Returns the GTU type for the given id.
|
(package private) static Double |
nullMultiply(Double d1,
Double d2)
Returns the multiplication of two values, taking 1.0 for
null and returning null if both null. |
final org.opentrafficsim.core.network.OTSNetwork network
org.opentrafficsim.road.gtu.strategical.od.Categorization categorization
Map<String,CategoryTag> categories
org.djunits.value.vdouble.vector.TimeVector globalTime
org.opentrafficsim.road.gtu.strategical.od.Interpolation globalInterpolation
public XmlOdParser(org.opentrafficsim.core.dsol.OTSDEVSSimulatorInterface simulator,
org.opentrafficsim.core.network.OTSNetwork network,
Set<org.opentrafficsim.core.gtu.GTUType> gtuTypes)
simulator - OTSDEVSSimulatorInterface; simulatornetwork - OTSNetwork; networkgtuTypes - Set; set of GTU typespublic org.opentrafficsim.core.gtu.GTUType getGTUType(String id) throws XmlParserException
id - String; idXmlParserException - if the GTU type is not availablepublic final void apply(URL url) throws XmlParserException
url - URL; URL to fileXmlParserException - if URL cannot be parsedpublic void apply(URL url, org.opentrafficsim.road.gtu.generator.od.ODOptions odOptions) throws XmlParserException
url - URL; URL to fileodOptions - ODOptions; OD optionsXmlParserException - if URL cannot be parsedpublic final void apply(InputStream stream) throws XmlParserException
stream - InputStream; streamXmlParserException - if URL cannot be parsedpublic final void apply(InputStream stream, org.opentrafficsim.road.gtu.generator.od.ODOptions odOptions) throws XmlParserException
stream - InputStream; streamodOptions - ODOptions; OD optionsXmlParserException - if URL cannot be parsedpublic final void apply(Node xmlNode) throws XmlParserException
xmlNode - Node; nodeXmlParserException - if URL cannot be parsedpublic void apply(Node xmlNode, org.opentrafficsim.road.gtu.generator.od.ODOptions odOptions) throws XmlParserException
xmlNode - Node; nodeodOptions - ODOptions; OD optionsXmlParserException - if URL cannot be parsedpublic final org.opentrafficsim.road.gtu.strategical.od.ODMatrix build(URL url) throws XmlParserException
url - URL; URL to fileXmlParserException - if URL cannot be parsedpublic final org.opentrafficsim.road.gtu.strategical.od.ODMatrix build(InputStream stream) throws XmlParserException
stream - InputStream; streamXmlParserException - if stream cannot be parsedpublic final org.opentrafficsim.road.gtu.strategical.od.ODMatrix build(Node xmlNode) throws XmlParserException
xmlNode - Node; nodeXmlParserException - if stream cannot be parsedstatic final Double nullMultiply(Double d1, Double d2)
null and returning null if both null.d1 - Double value 1d2 - Double value 2null and returning null if both nullCopyright © 2014–2018 Delft University of Technology. All rights reserved.