Package org.goplanit.tntp.input
Class TntpInputBuilder
- java.lang.Object
-
- org.goplanit.input.InputBuilderListener
-
- org.goplanit.tntp.input.TntpInputBuilder
-
- All Implemented Interfaces:
EventListener
,PlanitComponentListener
,EventListener
public class TntpInputBuilder extends InputBuilderListener
Class which reads input from TNTP files- Author:
- gman6028, markr
-
-
Constructor Summary
Constructors Constructor Description TntpInputBuilder(String networkFileLocation, String demandFileLocation, String nodeCoordinateFileLocation, String standardResultsFileLocation, Map<NetworkFileColumnType,Integer> networkFileColumns, SpeedUnits speedUnits, LengthUnits lengthUnits, double defaultMaximumSpeed)
ConstructorTntpInputBuilder(String networkFileLocation, String demandsFileLocation, String nodeCoordinateFileLocation, Map<NetworkFileColumnType,Integer> networkFileColumns, SpeedUnits speedUnits, LengthUnits lengthUnits, CapacityPeriod capacityPeriod, double defaultMaximumSpeed)
ConstructorTntpInputBuilder(String networkFileLocation, String demandFileLocation, Map<NetworkFileColumnType,Integer> networkFileColumns, SpeedUnits speedUnits, LengthUnits lengthUnits, double defaultMaximumSpeed)
ConstructorTntpInputBuilder(String networkFileLocation, String demandFileLocation, Map<NetworkFileColumnType,Integer> networkFileColumns, SpeedUnits speedUnits, LengthUnits lengthUnits, CapacityPeriod capacityPeriod, double defaultMaximumSpeed)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onPlanitComponentEvent(PlanitComponentEvent event)
Whenever a project component is created this method will be invokedprotected void
populateDemands(Demands demands, Zoning zoning, MacroscopicNetwork network)
Populates the Demands object from the input fileprotected void
populateMacroscopicNetwork(MacroscopicNetwork macroscopicNetwork)
Creates the physical network object from the data in the input fileprotected void
populatePhysicalCost(AbstractPhysicalCost costComponent, MacroscopicNetwork parentNetwork)
Populate the BPR parametersprotected void
populateZoning(Zoning zoning, Object parameter1)
Creates the Zoning object and connectoids from the data in the network file In TNTP this method does not need to read a TAZ file.-
Methods inherited from class org.goplanit.input.InputBuilderListener
getKnownSupportedEventTypes
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.goplanit.utils.event.EventListener
hasKnownSupportedEventTypes
-
-
-
-
Constructor Detail
-
TntpInputBuilder
public TntpInputBuilder(String networkFileLocation, String demandFileLocation, Map<NetworkFileColumnType,Integer> networkFileColumns, SpeedUnits speedUnits, LengthUnits lengthUnits, CapacityPeriod capacityPeriod, double defaultMaximumSpeed) throws PlanItException
Constructor- Parameters:
networkFileLocation
- network file locationdemandFileLocation
- demand file locationnetworkFileColumns
- Map specifying which columns in the network file contain which valuesspeedUnits
- speed units being usedlengthUnits
- length units being usedcapacityPeriod
- time period for link capacitydefaultMaximumSpeed
- default maximum speed along a link- Throws:
PlanItException
- thrown if there is an error during running
-
TntpInputBuilder
public TntpInputBuilder(String networkFileLocation, String demandFileLocation, Map<NetworkFileColumnType,Integer> networkFileColumns, SpeedUnits speedUnits, LengthUnits lengthUnits, double defaultMaximumSpeed) throws PlanItException
Constructor- Parameters:
networkFileLocation
- network file locationdemandFileLocation
- demand file locationnetworkFileColumns
- Map specifying which columns in the network file contain which valuesspeedUnits
- speed units being usedlengthUnits
- length units being useddefaultMaximumSpeed
- default maximum speed along a link- Throws:
PlanItException
- thrown if there is an error during running
-
TntpInputBuilder
public TntpInputBuilder(String networkFileLocation, String demandFileLocation, String nodeCoordinateFileLocation, String standardResultsFileLocation, Map<NetworkFileColumnType,Integer> networkFileColumns, SpeedUnits speedUnits, LengthUnits lengthUnits, double defaultMaximumSpeed) throws PlanItException
Constructor- Parameters:
networkFileLocation
- network file locationdemandFileLocation
- demand file locationnodeCoordinateFileLocation
- node coordinate file locationstandardResultsFileLocation
- the location of the standard results filenetworkFileColumns
- Map specifying which columns in the network file contain which valuesspeedUnits
- speed units being usedlengthUnits
- length units being useddefaultMaximumSpeed
- default maximum speed along a link- Throws:
PlanItException
- thrown if there is an error during running
-
TntpInputBuilder
public TntpInputBuilder(String networkFileLocation, String demandsFileLocation, String nodeCoordinateFileLocation, Map<NetworkFileColumnType,Integer> networkFileColumns, SpeedUnits speedUnits, LengthUnits lengthUnits, CapacityPeriod capacityPeriod, double defaultMaximumSpeed) throws PlanItException
Constructor- Parameters:
networkFileLocation
- network file locationdemandsFileLocation
- demand file locationnodeCoordinateFileLocation
- node coordinate file locationnetworkFileColumns
- Map specifying which columns in the network file contain which valuesspeedUnits
- speed units being usedlengthUnits
- length units being usedcapacityPeriod
- time period for link capacitydefaultMaximumSpeed
- default maximum speed along links- Throws:
PlanItException
- thrown if there is an error during running
-
-
Method Detail
-
populateMacroscopicNetwork
protected void populateMacroscopicNetwork(MacroscopicNetwork macroscopicNetwork) throws PlanItException
Creates the physical network object from the data in the input file- Parameters:
macroscopicNetwork
- the network object to be populated from the input data- 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 datazoning
- Zoning object previously definednetwork
- Network to use- Throws:
PlanItException
- thrown if there is an error reading the input file
-
populateZoning
protected void populateZoning(Zoning zoning, Object parameter1) throws PlanItException
Creates the Zoning object and connectoids from the data in the network file In TNTP this method does not need to read a TAZ file. It simply uses the number of zones, which has already been read in from the network file.- Parameters:
zoning
- the Zoning object to be populated from the input dataparameter1
- the physical network object previously created- Throws:
PlanItException
- thrown if there is an error reading the input file
-
populatePhysicalCost
protected void populatePhysicalCost(AbstractPhysicalCost costComponent, MacroscopicNetwork parentNetwork) throws PlanItException
Populate the BPR parameters- Parameters:
costComponent
- the BPRLinkTravelTimeCost to be populatedparentNetwork
- top use for costs- Throws:
PlanItException
- thrown if there is an error
-
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 there is an error
-
-