Package org.goplanit.cost.physical
Class AbstractPhysicalCost
- java.lang.Object
-
- org.goplanit.component.PlanitComponent<AbstractPhysicalCost>
-
- org.goplanit.cost.physical.AbstractPhysicalCost
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<IdAble>
,EventListener
,PlanitComponentListener
,Cost<MacroscopicLinkSegment>
,PhysicalCost
,EventListener
,ExternalIdAble
,IdAble
- Direct Known Subclasses:
BPRLinkTravelTimeCost
,FreeFlowLinkTravelTimeCost
,SteadyStateTravelTimeCost
public abstract class AbstractPhysicalCost extends PlanitComponent<AbstractPhysicalCost> implements PhysicalCost, Serializable
Class for dynamic cost functions, which calculate link segment costs for each iteration- Author:
- markr, gman6028
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface org.goplanit.cost.physical.PhysicalCost
BPR, FREEFLOW, STEADY_STATE
-
-
Constructor Summary
Constructors Modifier Constructor Description AbstractPhysicalCost(AbstractPhysicalCost abstractPhysicalCost)
Copy Constructorprotected
AbstractPhysicalCost(IdGroupingToken groupId)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
initialiseBeforeSimulation(TransportLayerNetwork<?,?> network)
Initialize the cost parameter values in the networkvoid
populateWithCost(UntypedPhysicalLayer<?,?,?> physicalLayer, Mode mode, double[] costToFill)
Invoker expects (mode specific ) costs in passed in array to be filled, where each entry signifies a link segment by its id.abstract void
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
clone, equals, getComponentType, getExternalId, getId, getIdGroupingToken, getKnownSupportedEventTypes, getXmlId, hashCode, onPlanitComponentEvent, reset, setExternalId, setXmlId
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.goplanit.cost.Cost
getDTravelTimeDFlow, getGeneralisedCost, getTravelTimeCost
-
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
-
AbstractPhysicalCost
protected AbstractPhysicalCost(IdGroupingToken groupId)
- Parameters:
groupId
- , contiguous id generation within this group for instances of this class
-
AbstractPhysicalCost
public AbstractPhysicalCost(AbstractPhysicalCost abstractPhysicalCost)
Copy Constructor- Parameters:
abstractPhysicalCost
- to use
-
-
Method Detail
-
populateWithCost
public void populateWithCost(UntypedPhysicalLayer<?,?,?> physicalLayer, Mode mode, double[] costToFill) throws PlanItException
Invoker expects (mode specific ) costs in passed in array to be filled, where each entry signifies a link segment by its id. This allows for more efficient implementations than having to revert to one by one updates. It does however require network information hence its placement here where via the initialiseBeforeSimulation, the network is provided- Parameters:
physicalLayer
- these cost pertain tomode
- the mode these costs pertain tocostToFill
- array of link segment costs identified by the link segment's internal id- Throws:
PlanItException
- thrown if error
-
initialiseBeforeSimulation
public abstract void initialiseBeforeSimulation(TransportLayerNetwork<?,?> network) throws PlanItException
Initialize the cost parameter values in the network- Parameters:
network
- the network- Throws:
PlanItException
- thrown if error
-
updateTimePeriod
public abstract void updateTimePeriod(TimePeriod timePeriod)
Provide the cost calculation with information regarding the time period for which the cost is to be calculated- Parameters:
timePeriod
- to apply
-
-