Class NewellFundamentalDiagramComponent
- java.lang.Object
-
- org.goplanit.component.PlanitComponent<FundamentalDiagramComponent>
-
- org.goplanit.supply.fundamentaldiagram.FundamentalDiagramComponent
-
- org.goplanit.supply.fundamentaldiagram.NewellFundamentalDiagramComponent
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<IdAble>
,EventListener
,PlanitComponentListener
,EventListener
,ExternalIdAble
,IdAble
public class NewellFundamentalDiagramComponent extends FundamentalDiagramComponent
Newell fundamental diagram traffic component- Author:
- markr
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.goplanit.supply.fundamentaldiagram.FundamentalDiagramComponent
RELAXED_HASH_CODE_SCALE
-
-
Constructor Summary
Constructors Constructor Description NewellFundamentalDiagramComponent(NewellFundamentalDiagramComponent other)
Copy constructorNewellFundamentalDiagramComponent(IdGroupingToken groupId)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NewellFundamentalDiagramComponent
clone()
Create a shallow copy of this entityprotected void
initialiseDefaultFundamentalDiagramsForLayer(MacroscopicNetworkLayer parentNetworkLayer)
Populate the fundamental diagram component with FDs for each link segment type.FundamentalDiagram
register(MacroscopicLinkSegment linkSegment, NewellFundamentalDiagram fundamentalDiagram)
Register the given Newell fundamental diagram for the link segment.FundamentalDiagram
register(MacroscopicLinkSegmentType linkSegmentType, NewellFundamentalDiagram fundamentalDiagram)
Register the given Newell fundamental diagram for the link segment type.-
Methods inherited from class org.goplanit.supply.fundamentaldiagram.FundamentalDiagramComponent
asLinkSegmentIndexedArray, get, get, getKnownSupportedEventTypes, onPlanitComponentEvent, register, register, reset, setCapacityLinkSegmentPcuHourLane, setCapacityLinkSegmentTypePcuHourLane, setMaximumDensityLinkSegmentPcuKmLane, setMaximumDensityLinkSegmentTypePcuKmLane
-
Methods inherited from class org.goplanit.component.PlanitComponent
equals, getComponentType, getExternalId, getId, getIdGroupingToken, getXmlId, hashCode, 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
-
NewellFundamentalDiagramComponent
public NewellFundamentalDiagramComponent(IdGroupingToken groupId)
Constructor- Parameters:
groupId
- contiguous id generation within this group for instances of this class
-
NewellFundamentalDiagramComponent
public NewellFundamentalDiagramComponent(NewellFundamentalDiagramComponent other)
Copy constructor- Parameters:
other
- to copy
-
-
Method Detail
-
initialiseDefaultFundamentalDiagramsForLayer
protected void initialiseDefaultFundamentalDiagramsForLayer(MacroscopicNetworkLayer parentNetworkLayer)
Populate the fundamental diagram component with FDs for each link segment type. We do not generate any specifically for a link segment unless the physical speed limit of the link is more restrictive than the one posted in the type. This however is rare and will also trigger a warning to the user. The user can then further change the used Fds via the configurator if desired.It will generate all fundamental diagrams per macroscopic link segment type. In case the fundamental diagrams can be constructed based solely on physical characteristics, i.e., free speed, we do so. If the registered link segment types explicitly require a particular capacity to be used than the estimated capacity of the FD is overruled with the one of the type (or if the FD cannot derive its capacity from physical characteristics, in which case either the set or default capacity of the link segment type is used).
- Specified by:
initialiseDefaultFundamentalDiagramsForLayer
in classFundamentalDiagramComponent
- Parameters:
parentNetworkLayer
- to use
-
clone
public NewellFundamentalDiagramComponent clone()
Create a shallow copy of this entity- Specified by:
clone
in interfaceIdAble
- Specified by:
clone
in classFundamentalDiagramComponent
- Returns:
- shallow copy of entity
-
register
public FundamentalDiagram register(MacroscopicLinkSegment linkSegment, NewellFundamentalDiagram fundamentalDiagram)
Register the given Newell fundamental diagram for the link segment. This overrules the fundamental diagram that would be used based on the link segment's type. In case there already exists an identical fundamental diagram (based on relaxed hashcode comparison), the link segment is assigned the already present fundamental diagram. The fundamental diagram used for the link segment is returned, which is either the passed in one, or an already present functionally identical version- Parameters:
linkSegment
- to usefundamentalDiagram
- to register- Returns:
- used Fd for the link segment, can be different (but functionally equivalent) if registered Fd was already present for another link segment
-
register
public FundamentalDiagram register(MacroscopicLinkSegmentType linkSegmentType, NewellFundamentalDiagram fundamentalDiagram)
Register the given Newell fundamental diagram for the link segment type. In case there already exists an identical fundamental diagram (based on relaxed hashcode comparison), the link segment type is assigned the already present fundamental diagram. The fundamental diagram used for the link segment type is returned, which is either the passed in one, or an already present functionally identical version- Parameters:
linkSegmentType
- to usefundamentalDiagram
- to register- Returns:
- used Fd for the link segment type, can be different (but functionally equivalent) if registered Fd was already present for another link segment
-
-