Package org.goplanit.cost.physical
Class FreeFlowLinkTravelTimeCost
- java.lang.Object
-
- org.goplanit.component.PlanitComponent<AbstractPhysicalCost>
-
- org.goplanit.cost.physical.AbstractPhysicalCost
-
- org.goplanit.cost.physical.FreeFlowLinkTravelTimeCost
-
- All Implemented Interfaces:
Serializable
,Comparable<IdAble>
,EventListener
,PlanitComponentListener
,Cost<MacroscopicLinkSegment>
,PhysicalCost<MacroscopicLinkSegment>
,EventListener
,ExternalIdAble
,IdAble
public class FreeFlowLinkTravelTimeCost extends AbstractPhysicalCost
Simplest possible travel time cost, namely fixed to free flow travel time regardless of the flows measured.- Author:
- markr
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface org.goplanit.cost.physical.PhysicalCost
BPR, FREEFLOW, STEADY_STATE
-
-
Constructor Summary
Constructors Constructor Description FreeFlowLinkTravelTimeCost(FreeFlowLinkTravelTimeCost other, boolean deepCopy)
Copy ConstructorFreeFlowLinkTravelTimeCost(IdGroupingToken groupId)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,String>
collectSettingsAsKeyValueMap()
Provide all the settings of this particular component by name and value, where each value is a string representation of the underlying entityFreeFlowLinkTravelTimeCost
deepClone()
deep clone on planit component should attempt to also update internal dependencies between deep cloned containers where possibledouble
getDTravelTimeDFlow(boolean uncongested, Mode mode, MacroscopicLinkSegment linkSegment)
Derivative of free flow travel time is zerodouble
getGeneralisedCost(Mode mode, MacroscopicLinkSegment linkSegment)
Return the free flow travel time for the current link for a given mode If the input data are invalid, this method returns a negative value.double
getTravelTimeCost(Mode mode, MacroscopicLinkSegment linkSegment)
Returns the generalised cost of travel along an edge segment for a specified modevoid
initialiseBeforeSimulation(LayeredNetwork<?,?> network)
Initialize the cost parameter values in the networkvoid
reset()
All components should be able to reset going back to some representative initial stateFreeFlowLinkTravelTimeCost
shallowClone()
Create a shallow copy of this entityvoid
updateTimePeriod(TimePeriod timePeriod)
Provide the cost calculation with information regarding the time period for which the cost is to be calculated-
Methods inherited from class org.goplanit.cost.physical.AbstractPhysicalCost
populateWithCost
-
Methods inherited from class org.goplanit.component.PlanitComponent
equals, getComponentType, getExternalId, getId, getIdGroupingToken, getKnownSupportedEventTypes, getXmlId, hashCode, onPlanitComponentEvent, setExternalId, setXmlId
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.goplanit.utils.event.EventListener
hasKnownSupportedEventTypes
-
Methods inherited from interface org.goplanit.utils.id.ExternalIdAble
appendExternalId, appendExternalId, getIdsAsString, getSplitExternalId, getSplitExternalId, hasExternalId, hasXmlId, setXmlId
-
Methods inherited from interface org.goplanit.utils.id.IdAble
compareTo, idEquals, idHashCode
-
-
-
-
Constructor Detail
-
FreeFlowLinkTravelTimeCost
public FreeFlowLinkTravelTimeCost(IdGroupingToken groupId)
Constructor- Parameters:
groupId
- contiguous id generation within this group for instances of this class
-
FreeFlowLinkTravelTimeCost
public FreeFlowLinkTravelTimeCost(FreeFlowLinkTravelTimeCost other, boolean deepCopy)
Copy Constructor- Parameters:
other
- to copydeepCopy
- when true, create a deep copy, shallow copy otherwise
-
-
Method Detail
-
initialiseBeforeSimulation
public void initialiseBeforeSimulation(LayeredNetwork<?,?> network) throws PlanItException
Initialize the cost parameter values in the network- Specified by:
initialiseBeforeSimulation
in classAbstractPhysicalCost
- Parameters:
network
- the network- Throws:
PlanItException
- thrown if error
-
updateTimePeriod
public void updateTimePeriod(TimePeriod timePeriod)
Provide the cost calculation with information regarding the time period for which the cost is to be calculated- Specified by:
updateTimePeriod
in classAbstractPhysicalCost
- Parameters:
timePeriod
- to apply
-
getGeneralisedCost
public double getGeneralisedCost(Mode mode, MacroscopicLinkSegment linkSegment)
Return the free flow travel time for the current link for a given mode If the input data are invalid, this method returns a negative value.- Parameters:
mode
- the current Mode of travellinkSegment
- the current link segment- Returns:
- the travel time for the current link (in hours)
-
getTravelTimeCost
public double getTravelTimeCost(Mode mode, MacroscopicLinkSegment linkSegment)
Returns the generalised cost of travel along an edge segment for a specified mode- Parameters:
mode
- the specified mode of travellinkSegment
- the specified edge segment (which can be physical or virtual)- Returns:
- the cost of travel along the specified segment
-
getDTravelTimeDFlow
public double getDTravelTimeDFlow(boolean uncongested, Mode mode, MacroscopicLinkSegment linkSegment)
Derivative of free flow travel time is zero- Parameters:
uncongested
- flag idicating if the provided flow is uncongested or congested flow, relevant when flow can represent multiple traffic statesmode
- to uselinkSegment
- to use- Returns:
- the first derivative of travel time for a unit flow rate change in PCU per Hour
-
shallowClone
public FreeFlowLinkTravelTimeCost shallowClone()
Create a shallow copy of this entity- Specified by:
shallowClone
in interfaceIdAble
- Specified by:
shallowClone
in classPlanitComponent<AbstractPhysicalCost>
- Returns:
- shallow copy of entity
-
deepClone
public FreeFlowLinkTravelTimeCost deepClone()
deep clone on planit component should attempt to also update internal dependencies between deep cloned containers where possible- Specified by:
deepClone
in interfaceIdAble
- Specified by:
deepClone
in classPlanitComponent<AbstractPhysicalCost>
- Returns:
- deep copy of entity
-
reset
public void reset()
All components should be able to reset going back to some representative initial state- Specified by:
reset
in classPlanitComponent<AbstractPhysicalCost>
-
collectSettingsAsKeyValueMap
public Map<String,String> collectSettingsAsKeyValueMap()
Provide all the settings of this particular component by name and value, where each value is a string representation of the underlying entity- Specified by:
collectSettingsAsKeyValueMap
in classPlanitComponent<AbstractPhysicalCost>
- Returns:
- name-value map of all (user configurable) settings
-
-