Package org.goplanit.io.project
Class PlanItSimpleProject
- java.lang.Object
-
- org.goplanit.project.CustomPlanItProject
-
- org.goplanit.io.project.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:- Use the native output formatter (PLANitIO format)
- Use a macroscopic network
- Use the native input parser (PLANitIO format)
- The assignment will by default persist link outputs and OD outputs (no paths)
- Parsing of the inputs occurs after configuration of all other components to quickly identify user configuration errors
- Author:
- markr
-
-
Field Summary
-
Fields inherited from class org.goplanit.project.CustomPlanItProject
assignmentBuilders, id, inputBuilderListener, inputs, odPathSets, outputFormatters, physicalNetworks, projectToken, routedServices, serviceNetworks, zonings
-
-
Constructor Summary
Constructors Constructor Description PlanItSimpleProject()
Base constructor for simple project which adopts the PlanItIO input/output format.PlanItSimpleProject(String projectPath)
Base constructor for simple project which adopts the PlanItIO input/output formatPlanItSimpleProject(PlanItInputBuilder planItInputBuilder)
Default constructor without explicit project path (use default)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TrafficAssignmentConfigurator<? extends TrafficAssignment>
createAndRegisterTrafficAssignment(String trafficAssignmentType)
On a simple project we only allow a single assignment to be registered.TrafficAssignmentConfigurator<? extends TrafficAssignment>
createAndRegisterTrafficAssignment(String trafficAssignmentType, Demands theDemands, Zoning theZoning, LayeredNetwork<?,?> theNetwork)
Disallow the use of the generic create and register traffic assignment because a simple project automatically determines its demands, zoning, and networkvoid
executeAllTrafficAssignments()
Execute all registered traffic assignments Top-level error recording is done in this class.PlanItOutputFormatter
getDefaultOutputFormatter()
Collect the default output formatter for PLANit simple project which is the native XMLFormatterDemands
getDemands()
Return the current Demands objectMacroscopicNetwork
getNetwork()
Return the current network objectZoning
getZoning()
Return the current Zoning object-
Methods inherited from class org.goplanit.project.CustomPlanItProject
createAndRegisterDemands, createAndRegisterInfrastructureNetwork, createAndRegisterInitialLinkSegmentCost, createAndRegisterInitialLinkSegmentCost, createAndRegisterMacroscopicNetwork, createAndRegisterOdPathSets, createAndRegisterOutputFormatter, createAndRegisterRoutedServices, createAndRegisterServiceNetwork, createAndRegisterZoning, executeTrafficAssignment, getInitialLinkSegmentCost, getOutputFormatter, registerEligibleTrafficComponentClass
-
-
-
-
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
-
createAndRegisterTrafficAssignment
public TrafficAssignmentConfigurator<? extends TrafficAssignment> createAndRegisterTrafficAssignment(String trafficAssignmentType, Demands theDemands, Zoning theZoning, LayeredNetwork<?,?> theNetwork) throws PlanItException
Disallow the use of the generic create and register traffic assignment because a simple project automatically determines its demands, zoning, and network- Overrides:
createAndRegisterTrafficAssignment
in classCustomPlanItProject
- Parameters:
trafficAssignmentType
- the traffic assignment typetheDemands
- the demandstheZoning
- the zoningtheNetwork
- the network- Returns:
- the traffic assignment configurator object
- Throws:
PlanItException
- thrown if there is an 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 classCustomPlanItProject
- 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
-
-