Package org.planit.tntp.input
Class TntpInputBuilder
- java.lang.Object
-
- org.planit.input.InputBuilderListener
-
- org.planit.tntp.input.TntpInputBuilder
-
- All Implemented Interfaces:
Serializable,EventListener,org.djutils.event.EventListenerInterface
public class TntpInputBuilder extends InputBuilderListener
Class which reads input from TNTP files- Author:
- gman6028
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringEND_OF_METADATA_INDICATORstatic StringNUMBER_OF_LINKS_INDICATORstatic StringNUMBER_OF_NODES_INDICATORstatic StringNUMBER_OF_ZONES_INDICATORstatic intONE_WAY_ABstatic intONE_WAY_BAstatic intTWO_WAY-
Fields inherited from class org.planit.input.InputBuilderListener
DEFAULT_ERROR_ON_DUPLICATE_SOURCE_ID, sourceIdConnectoidMap, sourceIdLinkSegmentMap, sourceIdLinkSegmentTypeMap, sourceIdModeMap, sourceIdNodeMap, sourceIdTimePeriodMap, sourceIdTravelerTypeMap, sourceIdUserClassMap, sourceIdZoneMap
-
-
Constructor Summary
Constructors Constructor Description TntpInputBuilder(String networkFileLocation, String demandFileLocation, String nodeCoordinateFileLocation, String standardResultsFileLocation, Map<NetworkFileColumns,Integer> networkFileColumns, SpeedUnits speedUnits, LengthUnits lengthUnits, double defaultMaximumSpeed)ConstructorTntpInputBuilder(String networkFileLocation, String demandFileLocation, String nodeCoordinateFileLocation, Map<NetworkFileColumns,Integer> networkFileColumns, SpeedUnits speedUnits, LengthUnits lengthUnits, CapacityPeriod capacityPeriod, double defaultMaximumSpeed)ConstructorTntpInputBuilder(String networkFileLocation, String demandFileLocation, Map<NetworkFileColumns,Integer> networkFileColumns, SpeedUnits speedUnits, LengthUnits lengthUnits, double defaultMaximumSpeed)ConstructorTntpInputBuilder(String networkFileLocation, String demandFileLocation, Map<NetworkFileColumns,Integer> networkFileColumns, SpeedUnits speedUnits, LengthUnits lengthUnits, CapacityPeriod capacityPeriod, double defaultMaximumSpeed)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidnotify(org.djutils.event.EventInterface event)Whenever a project component is created this method will be invokedprotected voidpopulateDemands(Demands demands, Object parameter1)Populates the Demands object from the input fileprotected voidpopulateInfrastructureNetwork(InfrastructureNetwork network)Creates the physical network object from the data in the input fileprotected voidpopulatePhysicalCost(AbstractPhysicalCost costComponent)Populate the BPR parametersprotected voidpopulateZoning(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.planit.input.InputBuilderListener
addConnectoidToSourceIdMap, addLinkSegmentToSourceIdMap, addLinkSegmentTypeToSourceIdMap, addModeToSourceIdMap, addNodeToSourceIdMap, addTimePeriodToSourceIdMap, addTravelerTypeToSourceIdMap, addUserClassToSourceIdMap, addZoneToSourceIdMap, getAllModesBySourceId, getConnectoidBySourceId, getLinkSegmentByExternalId, getLinkSegmentByXmlId, getLinkSegmentTypeBySourceId, getModeBySourceId, getNodeByXmlId, getNumberOfRegisteredTimePeriods, getTimePeriodBySourceId, getTimePeriodSourceIds, getTravelerTypeBySourceId, getUserClassBySourceId, getZoneBySourceId, isTimePeriodSourceIdRegistered
-
-
-
-
Field Detail
-
ONE_WAY_AB
public static final int ONE_WAY_AB
- See Also:
- Constant Field Values
-
ONE_WAY_BA
public static final int ONE_WAY_BA
- See Also:
- Constant Field Values
-
TWO_WAY
public static final int TWO_WAY
- See Also:
- Constant Field Values
-
NUMBER_OF_ZONES_INDICATOR
public static final String NUMBER_OF_ZONES_INDICATOR
- See Also:
- Constant Field Values
-
NUMBER_OF_NODES_INDICATOR
public static final String NUMBER_OF_NODES_INDICATOR
- See Also:
- Constant Field Values
-
NUMBER_OF_LINKS_INDICATOR
public static final String NUMBER_OF_LINKS_INDICATOR
- See Also:
- Constant Field Values
-
END_OF_METADATA_INDICATOR
public static final String END_OF_METADATA_INDICATOR
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TntpInputBuilder
public TntpInputBuilder(String networkFileLocation, String demandFileLocation, Map<NetworkFileColumns,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<NetworkFileColumns,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<NetworkFileColumns,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 demandFileLocation, String nodeCoordinateFileLocation, Map<NetworkFileColumns,Integer> networkFileColumns, SpeedUnits speedUnits, LengthUnits lengthUnits, CapacityPeriod capacityPeriod, double defaultMaximumSpeed) throws PlanItException
Constructor- Parameters:
networkFileLocation- network file locationdemandFileLocation- 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
-
populateInfrastructureNetwork
protected void populateInfrastructureNetwork(InfrastructureNetwork network) throws PlanItException
Creates the physical network object from the data in the input file- Parameters:
network- 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, Object parameter1) throws PlanItException
Populates the Demands object from the input file- Parameters:
demands- the Demands object to be populated from the input dataparameter1- Zoning object previously defined- 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) throws PlanItException
Populate the BPR parameters- Parameters:
costComponent- the BPRLinkTravelTimeCost to be populated- Throws:
PlanItException- thrown if there is an error
-
notify
public void notify(org.djutils.event.EventInterface event) throws RemoteExceptionWhenever a project component is created this method will be invoked- Parameters:
event- event containing the created (and empty) project component- Throws:
RemoteException- thrown if there is an error
-
-