Class FundamentalDiagramImpl
- java.lang.Object
-
- org.goplanit.supply.fundamentaldiagram.FundamentalDiagramImpl
-
- All Implemented Interfaces:
Cloneable
,FundamentalDiagram
- Direct Known Subclasses:
NewellFundamentalDiagram
public abstract class FundamentalDiagramImpl extends Object implements FundamentalDiagram
Base class for fundamental diagram instances- Author:
- markr
-
-
Field Summary
-
Fields inherited from interface org.goplanit.supply.fundamentaldiagram.FundamentalDiagram
NEWELL
-
-
Constructor Summary
Constructors Constructor Description FundamentalDiagramImpl(FundamentalDiagramBranch freeFlowBranch, FundamentalDiagramBranch congestedBranch)
ConstructorFundamentalDiagramImpl(FundamentalDiagramImpl fundamentalDiagramImpl)
Copy Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract FundamentalDiagram
clone()
Clone the fundamental diagramFundamentalDiagramBranch
getCongestedBranch()
Congested branch of the FDFundamentalDiagramBranch
getFreeFlowBranch()
Free flow branch of the FDint
relaxedHashCode(int scale)
A fundamental diagram is based on a limited number of double variables to define it.-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.goplanit.supply.fundamentaldiagram.FundamentalDiagram
getCapacityFlowPcuHour, getMaximumDensityPcuKm, getMaximumSpeedKmHour, setCapacityPcuHour, setMaximumDensityPcuKmHour, setMaximumSpeedKmHour
-
-
-
-
Constructor Detail
-
FundamentalDiagramImpl
public FundamentalDiagramImpl(FundamentalDiagramBranch freeFlowBranch, FundamentalDiagramBranch congestedBranch)
Constructor- Parameters:
freeFlowBranch
- to usecongestedBranch
- to use
-
FundamentalDiagramImpl
public FundamentalDiagramImpl(FundamentalDiagramImpl fundamentalDiagramImpl)
Copy Constructor- Parameters:
fundamentalDiagramImpl
- to copy
-
-
Method Detail
-
getFreeFlowBranch
public FundamentalDiagramBranch getFreeFlowBranch()
Free flow branch of the FD- Specified by:
getFreeFlowBranch
in interfaceFundamentalDiagram
- Returns:
- free flow branch
-
getCongestedBranch
public FundamentalDiagramBranch getCongestedBranch()
Congested branch of the FD- Specified by:
getCongestedBranch
in interfaceFundamentalDiagram
- Returns:
- congested branch
-
relaxedHashCode
public int relaxedHashCode(int scale)
A fundamental diagram is based on a limited number of double variables to define it. In case we want to use the same FD for extremely similar variables we can use this relaxed hash code that ensures that for the given precision level identical hashes are created even if the underlying floating point variables differ beyond this precision.- Specified by:
relaxedHashCode
in interfaceFundamentalDiagram
- Parameters:
scale
- indicating how many decimals to consider, e.g., 2 considers 2 decimals for precision- Returns:
- created relaxed hash code
-
clone
public abstract FundamentalDiagram clone()
Clone the fundamental diagram- Specified by:
clone
in interfaceFundamentalDiagram
- Overrides:
clone
in classObject
- Returns:
- cloned instance
-
-