Class NewellFundamentalDiagramComponent
- java.lang.Object
-
- org.goplanit.component.PlanitComponent<FundamentalDiagramComponent>
-
- org.goplanit.supply.fundamentaldiagram.FundamentalDiagramComponent
-
- org.goplanit.supply.fundamentaldiagram.NewellFundamentalDiagramComponent
-
- All Implemented Interfaces:
Serializable
,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, boolean deepCopy)
Copy constructorNewellFundamentalDiagramComponent(IdGroupingToken groupId)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,String>
collectSettingsAsKeyValueMap()
Provide all the settings of this particular component by name and value, where each value is a string representation of the underlying entityNewellFundamentalDiagramComponent
deepClone()
deep clone on planit component should attempt to also update internal dependencies between deep cloned containers where possibleprotected 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.NewellFundamentalDiagramComponent
shallowClone()
Create a shallow copy of this entity-
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
clone, 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
appendExternalId, appendExternalId, getIdsAsString, getSplitExternalId, getSplitExternalId, hasExternalId, hasXmlId, setXmlId
-
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, boolean deepCopy)
Copy constructor- Parameters:
other
- to copydeepCopy
- when true, create a deep copy, shallow copy otherwise
-
-
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
-
shallowClone
public NewellFundamentalDiagramComponent shallowClone()
Create a shallow copy of this entity- Specified by:
shallowClone
in interfaceIdAble
- Specified by:
shallowClone
in classFundamentalDiagramComponent
- Returns:
- shallow copy of entity
-
deepClone
public NewellFundamentalDiagramComponent deepClone()
deep clone on planit component should attempt to also update internal dependencies between deep cloned containers where possible- Specified by:
deepClone
in interfaceIdAble
- Specified by:
deepClone
in classFundamentalDiagramComponent
- Returns:
- deep 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
-
collectSettingsAsKeyValueMap
public Map<String,String> collectSettingsAsKeyValueMap()
Provide all the settings of this particular component by name and value, where each value is a string representation of the underlying entity- Specified by:
collectSettingsAsKeyValueMap
in classPlanitComponent<FundamentalDiagramComponent>
- Returns:
- name-value map of all (user configurable) settings
-
-