Class PlanitDemandsReader

    • Field Detail

      • demands

        protected Demands demands
        the demands to populate
      • DEMAND_XSD_FILE

        public static final String DEMAND_XSD_FILE
        Reference to demand schema location TODO: move to properties file
        See Also:
        Constant Field Values
    • 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.goplanit.xml.generated.XMLElementMacroscopicDemand xmlMacroscopicDemands,
                                   MacroscopicNetwork network,
                                   Zoning zoning,
                                   Demands demandsToPopulate)
                            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
        network - reference network for the demands to read
        zoning - reference zoning for the demands to read
        demandsToPopulate - 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()
                                            throws PlanItException
        Sets up all the configuration data from the XML demands file
        Throws:
        PlanItException - thrown if there is a duplicate XML Id found for any component
      • populateDemandContents

        protected void populateDemandContents()
                                       throws PlanItException
        Parses the demand contents of the XML
        Throws:
        PlanItException - thrown if error
      • reset

        public void reset()
        reset the reader to allow for marking unnecessary resources for garbage collection
        Specified by:
        reset in interface ConverterEntity