Package org.planit.cost.virtual
Class FixedConnectoidTravelTimeCost
- java.lang.Object
-
- org.djutils.event.EventProducer
-
- org.planit.assignment.TrafficAssignmentComponent<AbstractVirtualCost>
-
- org.planit.cost.virtual.AbstractVirtualCost
-
- org.planit.cost.virtual.FixedConnectoidTravelTimeCost
-
- All Implemented Interfaces:
Serializable
,Comparable<Idable>
,org.djutils.event.EventProducerInterface
,Cost<ConnectoidSegment>
,VirtualCost
,Idable
public class FixedConnectoidTravelTimeCost extends AbstractVirtualCost
Class holding fixed connectoid costs for each connectoid segment- Author:
- markr
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected double
fixedConnectoidCost
Fixed connectoid cost for connectoid segments - defaults to zero-
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 FixedConnectoidTravelTimeCost(IdGroupingToken groupId)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getSegmentCost(Mode mode, ConnectoidSegment connectoidSegment)
Calculates the connectoid segment cost using a fixed travel timevoid
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
setFixedConnectoidCost(double fixedConnectoidCost)
set the fixed cost used for all relevant link segments-
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
-
-
-
-
Constructor Detail
-
FixedConnectoidTravelTimeCost
public FixedConnectoidTravelTimeCost(IdGroupingToken groupId)
Constructor- Parameters:
groupId
- , contiguous id generation within this group for instances of this class
-
-
Method Detail
-
setFixedConnectoidCost
public void setFixedConnectoidCost(double fixedConnectoidCost)
set the fixed cost used for all relevant link segments- Parameters:
fixedConnectoidCost
- the fixed cost to use
-
getSegmentCost
public double getSegmentCost(Mode mode, ConnectoidSegment connectoidSegment)
Calculates the connectoid segment cost using a fixed travel time- Parameters:
mode
- mode of travelconnectoidSegment
- the connectoid segment- Returns:
- the travel time for the specified connectoid segment
-
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
-
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
-
-