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
,Cloneable
,Comparable<IdAble>
,EventListener
,PlanitComponentListener
,Cost<MacroscopicLinkSegment>
,PhysicalCost
,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)
Copy ConstructorFreeFlowLinkTravelTimeCost(IdGroupingToken groupId)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FreeFlowLinkTravelTimeCost
clone()
Create a shallow copy of this entitydouble
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(TransportLayerNetwork<?,?> network)
Initialize the cost parameter values in the networkvoid
reset()
All components should be able to reset going back to some representative initial statevoid
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
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
hasExternalId, hasXmlId
-
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)
Copy Constructor- Parameters:
other
- to copy
-
-
Method Detail
-
initialiseBeforeSimulation
public void initialiseBeforeSimulation(TransportLayerNetwork<?,?> 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
-
clone
public FreeFlowLinkTravelTimeCost clone()
Create a shallow copy of this entity- Specified by:
clone
in interfaceIdAble
- Specified by:
clone
in classPlanitComponent<AbstractPhysicalCost>
- Returns:
- shallow 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>
-
-