Class PlanitDemandsReader


  • public class PlanitDemandsReader
    extends PlanitXmlReader<org.planit.xml.generated.XMLElementMacroscopicDemand>
    • Constructor Detail

      • PlanitDemandsReader

        public PlanitDemandsReader​(String pathDirectory,
                                   String xmlFileExtension,
                                   Demands demands)
                            throws PlanItException
        constructor
        Parameters:
        pathDirectory - to use
        xmlFileExtension - to use
        demands - to populate
        Throws:
        PlanItException - thrown if error
      • PlanitDemandsReader

        public PlanitDemandsReader​(org.planit.xml.generated.XMLElementMacroscopicDemand xmlMacroscopicDemands,
                                   Demands demands)
                            throws PlanItException
        constructor where file has already been parsed and we only need to convert from raw XML objects to PLANit memory model
        Parameters:
        xmlMacroscopicDemands - to extract from
        demands - 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 to
        sourceIdModeMap - 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 to
        xmlIdZoneMap - 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 utilise
        zoning - to utilise
        xmlIdModeMap - to obtain available modes by Xml id
        xmlIdZoneMap - to obtain zones by Xml id
        Throws:
        PlanItException - thrown if error