Package org.planit.cost.virtual
Class SpeedConnectoidTravelTimeCost
- java.lang.Object
-
- org.djutils.event.EventProducer
-
- org.planit.assignment.TrafficAssignmentComponent<AbstractVirtualCost>
-
- org.planit.cost.virtual.AbstractVirtualCost
-
- org.planit.cost.virtual.SpeedConnectoidTravelTimeCost
-
- All Implemented Interfaces:
Serializable
,Comparable<Idable>
,org.djutils.event.EventProducerInterface
,Cost<ConnectoidSegment>
,VirtualCost
,Idable
public class SpeedConnectoidTravelTimeCost extends AbstractVirtualCost
Class to calculate the connectoid travel time using connectoid speed- Author:
- gman6028
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static double
DEFAULT_CONNECTOID_SPEED_KPH
-
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.virtual.VirtualCost
FIXED, SPEED
-
-
Constructor Summary
Constructors Constructor Description SpeedConnectoidTravelTimeCost(IdGroupingToken groupId)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getSegmentCost(Mode mode, ConnectoidSegment connectoidSegment)
Return the connectoid travel time using speedvoid
initialiseBeforeSimulation(VirtualNetwork virtualNetwork)
#Initialize the virtual cost componentvoid
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 idvoid
setConnectoidSpeed(double connectoidSpeed)
set the connectoid speed-
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.utils.id.Idable
compareTo, idEquals, idHashCode
-
-
-
-
Field Detail
-
DEFAULT_CONNECTOID_SPEED_KPH
public static final double DEFAULT_CONNECTOID_SPEED_KPH
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SpeedConnectoidTravelTimeCost
public SpeedConnectoidTravelTimeCost(IdGroupingToken groupId)
Constructor- Parameters:
groupId
- , contiguous id generation within this group for instances of this class
-
-
Method Detail
-
setConnectoidSpeed
public void setConnectoidSpeed(double connectoidSpeed)
set the connectoid speed- Parameters:
connectoidSpeed
- the speed
-
getSegmentCost
public double getSegmentCost(Mode mode, ConnectoidSegment connectoidSegment)
Return the connectoid travel time using speed- Parameters:
mode
- the mode of travelconnectoidSegment
- the connectoid segment- Returns:
- the travel time for this connectoid segment
-
populateWithCost
public void populateWithCost(Mode mode, double[] costToFill) throws PlanItException
Description copied from interface:VirtualCost
Invoker expects (mode specific ) costs in passed in array to be filled, where each entry signifies a link segment by its id- 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 void initialiseBeforeSimulation(VirtualNetwork virtualNetwork) throws PlanItException
#Initialize the virtual cost component- Specified by:
initialiseBeforeSimulation
in classAbstractVirtualCost
- Parameters:
virtualNetwork
- the virtual network- Throws:
PlanItException
- thrown if a link/mode combination exists for which no cost parameters have been set
-
-