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 nodeCoordinateFileLocation, String demandFileLocation)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TntpDemandsReaderSettings
getDemandsReaderSettings()
TntpNetworkReaderSettings
getNetworkReaderSettings()
TntpZoningReaderSettings
getZoningReaderSettings()
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 nodeCoordinateFileLocation, String demandFileLocation) throws PlanItException
Constructor. Most barebones constructor, requires user to change underlying settings regarding configuration of network, zoning etc. before continuing.- Parameters:
networkFileLocation
- network file locationnodeCoordinateFileLocation
- optional provision of node coordinates (may be null)demandFileLocation
- demand file location optional provision of demand file location (may be null)- 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)
Populate the BPR parameters- Parameters:
costComponent
- the BPRLinkTravelTimeCost to be populatedparentNetwork
- top use for costs
-
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
-
getDemandsReaderSettings
public TntpDemandsReaderSettings getDemandsReaderSettings()
-
getNetworkReaderSettings
public TntpNetworkReaderSettings getNetworkReaderSettings()
-
getZoningReaderSettings
public TntpZoningReaderSettings getZoningReaderSettings()
-
-