Package org.planit.io.demands
Class PlanitDemandsReader
- java.lang.Object
-
- org.planit.io.xml.util.PlanitXmlReader<org.planit.xml.generated.XMLElementMacroscopicDemand>
-
- org.planit.io.demands.PlanitDemandsReader
-
public class PlanitDemandsReader extends PlanitXmlReader<org.planit.xml.generated.XMLElementMacroscopicDemand>
-
-
Field Summary
Fields Modifier and Type Field Description protected Demandsdemandsthe demands to populateprotected PlanitDemandsReaderSettingssettingssettings for the zoning reader
-
Constructor Summary
Constructors Constructor Description PlanitDemandsReader(String pathDirectory, String xmlFileExtension, Demands demands)constructorPlanitDemandsReader(org.planit.xml.generated.XMLElementMacroscopicDemand xmlMacroscopicDemands, Demands demands)constructor where file has already been parsed and we only need to convert from raw XML objects to PLANit memory model
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PlanitDemandsReaderSettingsgetSettings()settings for this readerprotected voidpopulateDemandConfiguration(MacroscopicNetwork network, Map<String,Mode> sourceIdModeMap)Sets up all the configuration data from the XML demands fileprotected voidpopulateDemandContents(Zoning zoning, Map<String,Zone> xmlIdZoneMap)parses the demand contents of the Xmlvoidread(MacroscopicNetwork network, Zoning zoning, Map<String,Mode> xmlIdModeMap, Map<String,Zone> xmlIdZoneMap)parse the Xml and populate the demands memory modelprotected voidsetDemands(Demands demands)set the demands to populate-
Methods inherited from class org.planit.io.xml.util.PlanitXmlReader
clearXmlContent, getXmlRootElement, initialiseAndParseXmlRootElement
-
-
-
-
Field Detail
-
settings
protected final PlanitDemandsReaderSettings settings
settings for the zoning reader
-
demands
protected Demands demands
the demands to populate
-
-
Constructor Detail
-
PlanitDemandsReader
public PlanitDemandsReader(String pathDirectory, String xmlFileExtension, Demands demands) throws PlanItException
constructor- Parameters:
pathDirectory- to usexmlFileExtension- to usedemands- to populate- Throws:
PlanItException- thrown if error
-
PlanitDemandsReader
public PlanitDemandsReader(org.planit.xml.generated.XMLElementMacroscopicDemand xmlMacroscopicDemands, Demands demands) throws PlanItExceptionconstructor where file has already been parsed and we only need to convert from raw XML objects to PLANit memory model- Parameters:
xmlMacroscopicDemands- to extract fromdemands- to populate- Throws:
PlanItException- thrown if error
-
-
Method Detail
-
setDemands
protected void setDemands(Demands demands)
set the demands to populate- Parameters:
demands- to populate
-
populateDemandConfiguration
protected void populateDemandConfiguration(MacroscopicNetwork network, Map<String,Mode> sourceIdModeMap) throws PlanItException
Sets up all the configuration data from the XML demands file- Parameters:
network- these demands pertain tosourceIdModeMap- to obtain modes by Xml id- Throws:
PlanItException- thrown if there is a duplicate XML Id found for any component
-
populateDemandContents
protected void populateDemandContents(Zoning zoning, Map<String,Zone> xmlIdZoneMap) throws PlanItException
parses the demand contents of the Xml- Parameters:
zoning- to relate the demands toxmlIdZoneMap- to obtain zones by xml id- Throws:
PlanItException- thrown if error
-
read
public void read(MacroscopicNetwork network, Zoning zoning, Map<String,Mode> xmlIdModeMap, Map<String,Zone> xmlIdZoneMap) throws PlanItException
parse the Xml and populate the demands memory model- Parameters:
network- to utilisezoning- to utilisexmlIdModeMap- to obtain available modes by Xml idxmlIdZoneMap- to obtain zones by Xml id- Throws:
PlanItException- thrown if error
-
getSettings
public PlanitDemandsReaderSettings getSettings()
settings for this reader- Returns:
- settings
-
-