Package org.planit.cost.physical
Class AbstractPhysicalCost
- java.lang.Object
-
- org.djutils.event.EventProducer
-
- org.planit.assignment.TrafficAssignmentComponent<AbstractPhysicalCost>
-
- org.planit.cost.physical.AbstractPhysicalCost
-
- All Implemented Interfaces:
Serializable
,Comparable<Idable>
,org.djutils.event.EventProducerInterface
,Cost<MacroscopicLinkSegment>
,PhysicalCost
,Idable
- Direct Known Subclasses:
BPRLinkTravelTimeCost
public abstract class AbstractPhysicalCost extends TrafficAssignmentComponent<AbstractPhysicalCost> implements PhysicalCost
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 class org.planit.assignment.TrafficAssignmentComponent
id, tokenId, trafficComponentType
-
Fields inherited from interface org.djutils.event.EventProducerInterface
FIRST_POSITION, LAST_POSITION
-
Fields inherited from interface org.planit.cost.physical.PhysicalCost
BPR
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractPhysicalCost(IdGroupingToken groupId)
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract void
initialiseBeforeSimulation(InfrastructureNetwork network)
Initialize the cost parameter values in the networkabstract void
populateWithCost(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.-
Methods inherited from class org.planit.assignment.TrafficAssignmentComponent
equals, getId, getIdGroupingToken, getSourceId, getTrafficComponentType, hashCode
-
Methods inherited from class org.djutils.event.EventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, getEventTypesWithListeners, hasListeners, numberOfListeners, removeAllListeners, removeAllListeners, removeListener
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.planit.cost.Cost
getSegmentCost
-
Methods inherited from interface org.planit.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
-
-
Method Detail
-
populateWithCost
public abstract void populateWithCost(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 rewuire network information hence its placement here where via the initialiseBeforeSimulation, the network is provided- Parameters:
mode
- 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(InfrastructureNetwork network) throws PlanItException
Initialize the cost parameter values in the network- Parameters:
network
- the network- Throws:
PlanItException
- thrown if error
-
-