Class PlanItInputBuilder

    • Field Detail

      • DEFAULT_SEPARATOR

        public static final String DEFAULT_SEPARATOR
        The default separator that is assumed when no separator is provided
        See Also:
        Constant Field Values
    • Constructor Detail

      • PlanItInputBuilder

        public PlanItInputBuilder​(String projectPath)
                           throws PlanItException
        Constructor which generates the input objects from files in a specified directory, using the default extension ".xml"
        Parameters:
        projectPath - the location of the input file directory
        Throws:
        PlanItException - thrown if one of the input required input files cannot be found, or if there is an error reading one of them
      • PlanItInputBuilder

        public PlanItInputBuilder​(String projectPath,
                                  String xmlFileExtension)
                           throws PlanItException
        Constructor which generates the input objects from files in a specified directory
        Parameters:
        projectPath - the location of the input file directory
        xmlFileExtension - the extension of the data files to be searched through
        Throws:
        PlanItException - thrown if one of the input required input files cannot be found, or if there is an error reading one of them
    • Method Detail

      • populateMacroscopicNetwork

        protected void populateMacroscopicNetwork​(MacroscopicNetwork network)
                                           throws PlanItException
        Creates the macroscopic network object from the data in the input file
        Parameters:
        network - the infrastructure network object to be populated from the input data
        Throws:
        PlanItException - thrown if there is an error reading the input file
      • populateZoning

        protected void populateZoning​(Zoning zoning,
                                      MacroscopicNetwork network)
                               throws PlanItException
        Creates the Zoning object and connectoids from the data in the input file
        Parameters:
        zoning - the Zoning object to be populated from the input data
        network - PhysicalNetwork object previously defined
        Throws:
        PlanItException - thrown if there is an error reading the input file
      • populateDemands

        protected void populateDemands​(Demands demands,
                                       Zoning zoning,
                                       MacroscopicNetwork network)
                                throws PlanItException
        Populates the Demands object from the input file
        Parameters:
        demands - the Demands object to be populated from the input data
        zoning - Zoning object previously defined
        network - network object previously defined
        Throws:
        PlanItException - thrown if there is an error reading the input file
      • populateRoutedServices

        protected void populateRoutedServices​(RoutedServices routedServicesToPopulate)
                                       throws PlanItException
        Populate the routed services based on the local XML file if it can be found.
        Parameters:
        routedServicesToPopulate - to instance to populate
        Throws:
        PlanItException - thrown if error
      • populateServiceNetwork

        protected void populateServiceNetwork​(ServiceNetwork serviceNetworkToPopulate)
                                       throws PlanItException
        Populate the service network based on the local XML file if it can be found.
        Parameters:
        serviceNetworkToPopulate - to instance to populate
        Throws:
        PlanItException - thrown if error
      • populateInitialLinkSegmentCost

        protected void populateInitialLinkSegmentCost​(PopulateInitialLinkSegmentCostEvent initialCostEvent)
                                               throws PlanItException
        Populate the initial link segment cost from a CSV file
        Parameters:
        initialCostEvent - to extract context from to populate its component that it carries
        Throws:
        PlanItException - thrown if error
      • validateXmlInputFile

        public static boolean validateXmlInputFile​(File xmlFileLocation,
                                                   String schemaFileLocation)
        Validates an input XML file against an XSD file
        Parameters:
        xmlFileLocation - input XML file
        schemaFileLocation - XSD file to validate XML file against
        Returns:
        true if the file is valid, false otherwise
      • onPlanitComponentEvent

        public void onPlanitComponentEvent​(PlanitComponentEvent event)
                                    throws PlanItException
        Whenever a project component is created this method will be invoked
        Parameters:
        event - event containing the created (and empty) project component
        Throws:
        PlanItException - thrown if error