Class EconomyInfo
java.lang.Object
org.deltava.beans.econ.EconomyInfo
- All Implemented Interfaces:
Serializable
A bean to store information about simulated economic cycles.
- Since:
- 3.7
- Version:
- 11.2
- Author:
- Luke
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
Returns the target load amplitude.int
Returns the cycle length in days.double
Returns the frequency of the yearly oscilation.double
Returns the minimum load factor for a flight.Returns the airline start date.double
Returns the airline-wide target load.void
setCycleLength
(int days) Sets the yearly cycle length.void
setCyclesPerYear
(double hz) Sets the frequency of the yearly oscilation.void
setMinimumLoad
(double load) Updates the minimum load factor for a flight.void
setStartDate
(Instant dt) Updates the airline start date.toString()
-
Constructor Details
-
EconomyInfo
public EconomyInfo(double target, double amp) Initializes the economy. The amplitude cannot exceed one half of the difference between the target load and either 1 or 0.- Parameters:
target
- the target load factor between 0 and 1amp
- the target amplitude
-
-
Method Details
-
getTargetLoad
public double getTargetLoad()Returns the airline-wide target load.- Returns:
- the target load factor between 0 and 1
-
getMinimumLoad
public double getMinimumLoad()Returns the minimum load factor for a flight.- Returns:
- the load factor between 0 and 1
-
getAmplitude
public double getAmplitude()Returns the target load amplitude.- Returns:
- the amplitude
-
getStartDate
-
getCyclesPerYear
public double getCyclesPerYear()Returns the frequency of the yearly oscilation.- Returns:
- the number of cycles per year
-
getCycleLength
public int getCycleLength()Returns the cycle length in days.- Returns:
- the cycle length
-
setStartDate
Updates the airline start date. The time component will be cleared.- Parameters:
dt
- the start date/time
-
setMinimumLoad
public void setMinimumLoad(double load) Updates the minimum load factor for a flight.- Parameters:
load
- the load factor between 0 and 1
-
setCyclesPerYear
public void setCyclesPerYear(double hz) Sets the frequency of the yearly oscilation.- Parameters:
hz
- the number of cycles per year
-
setCycleLength
public void setCycleLength(int days) Sets the yearly cycle length.- Parameters:
days
- the number of days per cycle
-
toString
-