Class PlanItSimpleProject


  • public class PlanItSimpleProject
    extends CustomPlanItProject
    Wrapper around PLANitProject with most common defaults automatically activated. Limitations include: - Only allows for a single assignment - Only allows for a single zoning system, network and demands input Advanced users who want to utilize all the flexibility of PLANit should instead use CustomPLANitProject in the PLANit core. Default configuration for this type of project:
    1. Use the native output formatter (PLANitIO format)
    2. Use a macroscopic network
    3. Use the native input parser (PLANitIO format)
    4. The assignment will by default persist link outputs and OD outputs (no paths)
    5. Parsing of the inputs occurs after configuration of all other components to quickly identify user configuration errors
    Author:
    markr
    • Constructor Detail

      • PlanItSimpleProject

        public PlanItSimpleProject()
                            throws PlanItException
        Base constructor for simple project which adopts the PlanItIO input/output format. It is assumed all input files are in the current working directory
        Throws:
        PlanItException - thrown in case the default input builder cannot be created
      • PlanItSimpleProject

        public PlanItSimpleProject​(String projectPath)
                            throws PlanItException
        Base constructor for simple project which adopts the PlanItIO input/output format
        Parameters:
        projectPath - to retrieve the files from
        Throws:
        PlanItException - thrown if error
      • PlanItSimpleProject

        public PlanItSimpleProject​(PlanItInputBuilder planItInputBuilder)
        Default constructor without explicit project path (use default)
        Parameters:
        planItInputBuilder - the input builder
    • Method Detail

      • createAndRegisterTrafficAssignment

        public TrafficAssignmentConfigurator<? extends TrafficAssignment> createAndRegisterTrafficAssignment​(String trafficAssignmentType)
                                                                                                      throws PlanItException
        On a simple project we only allow a single assignment to be registered. This is verified here. If multiple assignments are required within the same project, then a simple project cannot be used. Registration of a traffic assignment type also includes parsing the network, zoning, and demands that are registered alongside the chosen assignment method
        Parameters:
        trafficAssignmentType - the traffic assignment type to be used
        Returns:
        trafficAssignmentConfigurator to configure this traffic assignment instance
        Throws:
        PlanItException - thrown if error
      • executeAllTrafficAssignments

        public void executeAllTrafficAssignments()
                                          throws PlanItException
        Execute all registered traffic assignments Top-level error recording is done in this class. If several traffic assignments are registered and one fails, we record its error and continue with the next assignment.
        Overrides:
        executeAllTrafficAssignments in class CustomPlanItProject
        Throws:
        PlanItException - required for subclasses which override this method and generate an exception before the runs start
      • getDefaultOutputFormatter

        public PlanItOutputFormatter getDefaultOutputFormatter()
        Collect the default output formatter for PLANit simple project which is the native XMLFormatter
        Returns:
        default output formatter
      • getNetwork

        public MacroscopicNetwork getNetwork()
        Return the current network object
        Returns:
        the current network
      • getZoning

        public Zoning getZoning()
        Return the current Zoning object
        Returns:
        the current zoning object
      • getDemands

        public Demands getDemands()
        Return the current Demands object
        Returns:
        the current demands