Package org.goplanit.cost.physical
Class SteadyStateTravelTimeCost
- java.lang.Object
-
- org.goplanit.component.PlanitComponent<AbstractPhysicalCost>
-
- org.goplanit.cost.physical.AbstractPhysicalCost
-
- org.goplanit.cost.physical.SteadyStateTravelTimeCost
-
- All Implemented Interfaces:
Serializable
,Comparable<IdAble>
,EventListener
,PlanitComponentListener
,Cost<MacroscopicLinkSegment>
,PhysicalCost<MacroscopicLinkSegment>
,InteractorAccessor<LinkInflowOutflowAccessee>
,LinkInflowOutflowAccessor
,EventListener
,ExternalIdAble
,IdAble
public class SteadyStateTravelTimeCost extends AbstractPhysicalCost implements LinkInflowOutflowAccessor
Cost computation for travel times based on the work of Raadsen and Bliemer (2019), Steady-state link travel time methods: Formulation, derivation, classification, and unification.Suitable for static and semi-dynamic traffic assignment methods that are steady-state with respect to their inflow and outflow rates which necessarily are able to take on different values, where the difference between in and outflow results in a queue on the link. Most notable assignment method that adopts this method is sLTM.
Raadsen and Bliemer (2019) highlight three main computation methods to compute the same steady-state travel time on the link level. In this implementation we utilise the so called static-functional - longitudinal method where we compute the travel time via three components: 1) free flow travel time + 2) hypocritical delay + 3) hypercritical delay
- Author:
- markr
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface org.goplanit.interactor.InteractorAccessor
LOGGER
-
Fields inherited from interface org.goplanit.cost.physical.PhysicalCost
BPR, FREEFLOW, STEADY_STATE
-
-
Constructor Summary
Constructors Constructor Description SteadyStateTravelTimeCost(SteadyStateTravelTimeCost other, boolean deepCopy)
Copy ConstructorSteadyStateTravelTimeCost(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 entitySteadyStateTravelTimeCost
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)
First Derivative towards inflowRate.double
getGeneralisedCost(Mode mode, MacroscopicLinkSegment linkSegment)
Return the average travel time for the current link segment for a given modedouble
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
populateWithCost(UntypedPhysicalLayer<?,?,MacroscopicLinkSegment> physicalLayer, Mode mode, double[] costToFill)
Populate the cost array with the free flow link travel times for all link segments for the specified modevoid
reset()
Full reset returns to pre-initialiseBeforeSimulation(LayeredNetwork)
state.void
setAccessee(LinkInflowOutflowAccessee accessee)
Set the accessee to allow accessSteadyStateTravelTimeCost
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.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
-
Methods inherited from interface org.goplanit.interactor.InteractorAccessor
setAccessee
-
Methods inherited from interface org.goplanit.interactor.LinkInflowOutflowAccessor
getCompatibleAccessee
-
-
-
-
Constructor Detail
-
SteadyStateTravelTimeCost
public SteadyStateTravelTimeCost(IdGroupingToken groupId)
Constructor- Parameters:
groupId
- contiguous id generation within this group for instances of this class
-
SteadyStateTravelTimeCost
public SteadyStateTravelTimeCost(SteadyStateTravelTimeCost 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 average travel time for the current link segment for a given mode- Specified by:
getGeneralisedCost
in interfaceCost<MacroscopicLinkSegment>
- Parameters:
mode
- the current Mode of travellinkSegment
- the current link segment- Returns:
- the travel time for the current link (in hours)
-
populateWithCost
public void populateWithCost(UntypedPhysicalLayer<?,?,MacroscopicLinkSegment> physicalLayer, Mode mode, double[] costToFill)
Populate the cost array with the free flow link travel times for all link segments for the specified mode- Overrides:
populateWithCost
in classAbstractPhysicalCost
- Parameters:
physicalLayer
- to usemode
- the mode to usecostToFill
- the cost to populate (in hours)
-
shallowClone
public SteadyStateTravelTimeCost 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 SteadyStateTravelTimeCost 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
-
setAccessee
public void setAccessee(LinkInflowOutflowAccessee accessee)
Set the accessee to allow access- Specified by:
setAccessee
in interfaceInteractorAccessor<LinkInflowOutflowAccessee>
- Parameters:
accessee
- to use
-
reset
public void reset()
Full reset returns to pre-initialiseBeforeSimulation(LayeredNetwork)
state.- Specified by:
reset
in classPlanitComponent<AbstractPhysicalCost>
-
getTravelTimeCost
public double getTravelTimeCost(Mode mode, MacroscopicLinkSegment linkSegment)
Returns the generalised cost of travel along an edge segment for a specified mode- Specified by:
getTravelTimeCost
in interfaceCost<MacroscopicLinkSegment>
- 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)
First Derivative towards inflowRate. HypocriticalDelay is FD dependent. HyperCritical delay equates to (timePeriod duration/2) * (1/outflowRate). Get the first derivative of the used travel time computation method towards the edge segment (in) flow rate in PCU per hour, i.e. dTraveltime//dFlow.- Specified by:
getDTravelTimeDFlow
in interfaceCost<MacroscopicLinkSegment>
- 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
-
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
-
-