Class NewellFundamentalDiagram
- java.lang.Object
-
- org.goplanit.supply.fundamentaldiagram.FundamentalDiagramImpl
-
- org.goplanit.supply.fundamentaldiagram.NewellFundamentalDiagram
-
- All Implemented Interfaces:
Cloneable
,FundamentalDiagram
public class NewellFundamentalDiagram extends FundamentalDiagramImpl
Implementation of a Newell (triangular) fundamental diagram for a road section (link segment)- Author:
- markr
-
-
Field Summary
-
Fields inherited from interface org.goplanit.supply.fundamentaldiagram.FundamentalDiagram
NEWELL
-
-
Constructor Summary
Constructors Constructor Description NewellFundamentalDiagram(double freeSpeedKmHour)
Constructor using all defaults except for the free speed to applyNewellFundamentalDiagram(double freeSpeedKmHour, double jamDensityPcuKm)
Constructor using all defaults except for the free speed to applyNewellFundamentalDiagram(double freeSpeedKmHour, double capacityPcuHour, double jamDensityPcuKm)
Constructor using all defaults except for the free speed to applyNewellFundamentalDiagram(LinearFundamentalDiagramBranch freeFlowBranch, LinearFundamentalDiagramBranch congestedBranch)
Constructor using all defaults except for the free speed to applyNewellFundamentalDiagram(NewellFundamentalDiagram newellFundamentalDiagram)
Copy constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NewellFundamentalDiagram
clone()
Clone the fundamental diagramprotected double
computeBackwardWaveSpeedForCapacity(double capacityPcuHour)
Compute the backward wave speed that goes with a given capacity keeping all other variables the samedouble
getCapacityFlowPcuHour()
Provide the capacity flow rate per hourLinearFundamentalDiagramBranch
getCongestedBranch()
Congested branch of the FDLinearFundamentalDiagramBranch
getFreeFlowBranch()
Free flow branch of the FDvoid
setCapacityPcuHour(double capacityPcuHour)
For the Newell FD this means that all remains the same except for the congested wave speed to ensure the FD remains viable since the capacity is derived and not explicitly set.void
setMaximumDensityPcuKmHour(double maxDensityPcuKm)
Change the maximum density to the new valuevoid
setMaximumSpeedKmHour(double maxSpeedKmHour)
Change the maximum speed to the new value-
Methods inherited from class org.goplanit.supply.fundamentaldiagram.FundamentalDiagramImpl
relaxedHashCode
-
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
getMaximumDensityPcuKm, getMaximumSpeedKmHour
-
-
-
-
Constructor Detail
-
NewellFundamentalDiagram
public NewellFundamentalDiagram(double freeSpeedKmHour)
Constructor using all defaults except for the free speed to apply- Parameters:
freeSpeedKmHour
- to use
-
NewellFundamentalDiagram
public NewellFundamentalDiagram(double freeSpeedKmHour, double jamDensityPcuKm)
Constructor using all defaults except for the free speed to apply- Parameters:
freeSpeedKmHour
- to usejamDensityPcuKm
- maximum density allowed
-
NewellFundamentalDiagram
public NewellFundamentalDiagram(double freeSpeedKmHour, double capacityPcuHour, double jamDensityPcuKm)
Constructor using all defaults except for the free speed to apply- Parameters:
freeSpeedKmHour
- to usecapacityPcuHour
- to allowjamDensityPcuKm
- maximum density allowed
-
NewellFundamentalDiagram
public NewellFundamentalDiagram(LinearFundamentalDiagramBranch freeFlowBranch, LinearFundamentalDiagramBranch congestedBranch)
Constructor using all defaults except for the free speed to apply- Parameters:
freeFlowBranch
- to usecongestedBranch
- to use
-
NewellFundamentalDiagram
public NewellFundamentalDiagram(NewellFundamentalDiagram newellFundamentalDiagram)
Copy constructor- Parameters:
newellFundamentalDiagram
- to copy
-
-
Method Detail
-
computeBackwardWaveSpeedForCapacity
protected double computeBackwardWaveSpeedForCapacity(double capacityPcuHour)
Compute the backward wave speed that goes with a given capacity keeping all other variables the same- Parameters:
capacityPcuHour
- to compute backward wave speed for ceteris paribus- Returns:
- proposed backward wave speed
-
getFreeFlowBranch
public LinearFundamentalDiagramBranch getFreeFlowBranch()
Free flow branch of the FD- Specified by:
getFreeFlowBranch
in interfaceFundamentalDiagram
- Overrides:
getFreeFlowBranch
in classFundamentalDiagramImpl
- Returns:
- free flow branch
-
getCongestedBranch
public LinearFundamentalDiagramBranch getCongestedBranch()
Congested branch of the FD- Specified by:
getCongestedBranch
in interfaceFundamentalDiagram
- Overrides:
getCongestedBranch
in classFundamentalDiagramImpl
- Returns:
- congested branch
-
getCapacityFlowPcuHour
public double getCapacityFlowPcuHour()
Provide the capacity flow rate per hour- Returns:
- capacity flow rate in pcu per hour
-
clone
public NewellFundamentalDiagram clone()
Clone the fundamental diagram- Specified by:
clone
in interfaceFundamentalDiagram
- Specified by:
clone
in classFundamentalDiagramImpl
- Returns:
- cloned instance
-
setCapacityPcuHour
public void setCapacityPcuHour(double capacityPcuHour)
For the Newell FD this means that all remains the same except for the congested wave speed to ensure the FD remains viable since the capacity is derived and not explicitly set. By chaning the backward wave speed to the adjusted value we ensure we obtain the desired capacity- Parameters:
capacityPcuHour
- to use
-
setMaximumDensityPcuKmHour
public void setMaximumDensityPcuKmHour(double maxDensityPcuKm)
Change the maximum density to the new value- Parameters:
maxDensityPcuKm
- to use
-
setMaximumSpeedKmHour
public void setMaximumSpeedKmHour(double maxSpeedKmHour)
Change the maximum speed to the new value- Parameters:
maxSpeedKmHour
- to use
-
-