Class AccessGroupPropertiesImpl
- java.lang.Object
-
- org.goplanit.network.layer.macroscopic.AccessGroupPropertiesImpl
-
- All Implemented Interfaces:
AccessGroupProperties
public class AccessGroupPropertiesImpl extends Object implements AccessGroupProperties
Group of modes with specific properties for the macroscopic perspective on the supply side, i.e. on a link segment of a particular type. While the group specifies the allowed modes, it is not compulsory to define restricted maximum and or critical speeds. When absent context of the mode and links is to be used to determine the applied maximum speeds.- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description protected Double
criticalSpeedKmH
Maximum speed of mode (tied to a road segment type) in km/hprotected Double
maxSpeedKmH
Maximum speed of mode (tied to a road segment type) in km/hprotected Set<Mode>
supportedModes
modes supported by this access group-
Fields inherited from interface org.goplanit.utils.network.layer.macroscopic.AccessGroupProperties
DEFAULT_SPEED_EPSILON
-
-
Constructor Summary
Constructors Constructor Description AccessGroupPropertiesImpl(Collection<Mode> accessModes)
access properties with only defining allowed modes without setting any restrictive speeds compared to the physical speed on the links it is applied onAccessGroupPropertiesImpl(AccessGroupPropertiesImpl other, boolean deepCopy)
Copy constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAccessMode(Mode mode)
Add mode to access group.AccessGroupProperties
deepClone()
Deep clone this instanceSet<Mode>
getAccessModes()
The access modes for this groupDouble
getCriticalSpeedKmH()
Collect the critical speed in km/hDouble
getMaximumSpeedKmH()
Collect the maximum speed in km/hboolean
isEqualExceptForModes(AccessGroupProperties accessProperties)
Verify if equal to given properties except for the allowed modesboolean
removeAccessMode(Mode toBeRemovedMode)
Remove access modevoid
setCriticalSpeedKmH(Double criticalSpeed)
set the critical speed in km/hvoid
setMaximumSpeedKmH(Double maxSpeedKmH)
set the maximum speed in km/hAccessGroupProperties
shallowClone()
Shallow clone this instanceString
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.goplanit.utils.network.layer.macroscopic.AccessGroupProperties
getCriticalSpeedOrDefaultKmH, getMaximumSpeedOrDefaultKmH, hasAccessModes, isCriticalSpeedKmHSet, isMaximumSpeedKmHSet
-
-
-
-
Constructor Detail
-
AccessGroupPropertiesImpl
public AccessGroupPropertiesImpl(Collection<Mode> accessModes)
access properties with only defining allowed modes without setting any restrictive speeds compared to the physical speed on the links it is applied on- Parameters:
accessModes
- to allow
-
AccessGroupPropertiesImpl
public AccessGroupPropertiesImpl(AccessGroupPropertiesImpl other, boolean deepCopy)
Copy constructor- Parameters:
other
- to copydeepCopy
- when true, create a deep copy, shallow copy otherwise
-
-
Method Detail
-
getMaximumSpeedKmH
public Double getMaximumSpeedKmH()
Collect the maximum speed in km/h- Specified by:
getMaximumSpeedKmH
in interfaceAccessGroupProperties
- Returns:
- the maximum speed in km/h
-
getCriticalSpeedKmH
public Double getCriticalSpeedKmH()
Collect the critical speed in km/h- Specified by:
getCriticalSpeedKmH
in interfaceAccessGroupProperties
- Returns:
- the critical speed in km/h
-
setMaximumSpeedKmH
public void setMaximumSpeedKmH(Double maxSpeedKmH)
set the maximum speed in km/h- Specified by:
setMaximumSpeedKmH
in interfaceAccessGroupProperties
- Parameters:
maxSpeedKmH
- to set
-
setCriticalSpeedKmH
public void setCriticalSpeedKmH(Double criticalSpeed)
set the critical speed in km/h- Specified by:
setCriticalSpeedKmH
in interfaceAccessGroupProperties
- Parameters:
criticalSpeed
- to set
-
shallowClone
public AccessGroupProperties shallowClone()
Shallow clone this instance- Specified by:
shallowClone
in interfaceAccessGroupProperties
- Returns:
- shallow copy of this instance
-
deepClone
public AccessGroupProperties deepClone()
Deep clone this instance- Specified by:
deepClone
in interfaceAccessGroupProperties
- Returns:
- deep copy of this instance
-
getAccessModes
public Set<Mode> getAccessModes()
The access modes for this group- Specified by:
getAccessModes
in interfaceAccessGroupProperties
- Returns:
- access modes
-
removeAccessMode
public boolean removeAccessMode(Mode toBeRemovedMode)
Remove access mode- Specified by:
removeAccessMode
in interfaceAccessGroupProperties
- Parameters:
toBeRemovedMode
- the to be removed mode- Returns:
- true when success, false otherwise
-
isEqualExceptForModes
public boolean isEqualExceptForModes(AccessGroupProperties accessProperties)
Verify if equal to given properties except for the allowed modes- Specified by:
isEqualExceptForModes
in interfaceAccessGroupProperties
- Parameters:
accessProperties
- to compare against- Returns:
- true when deemed equal, false otherwise
-
addAccessMode
public void addAccessMode(Mode mode)
Add mode to access group. Use with caution if registered on a link segment type, in which case adding the mode here is not sufficient since it also requires mode based indexing on the type. Better to use the link segment type methods to properly update the group access instead- Specified by:
addAccessMode
in interfaceAccessGroupProperties
- Parameters:
mode
- to add
-
-