Package com.opttek.optquest
Class COptQuestDiscountRateVariable
java.lang.Object
com.opttek.optquest.COptQuestVariable
com.opttek.optquest.COptQuestContinuousVariable
com.opttek.optquest.COptQuestProjectVariable
com.opttek.optquest.COptQuestDiscountRateVariable
The COptQuestDiscountRateVariable class defines a discount rate for portfolio
optimizations. Only one COptQuestDiscountRateVariable can be defined per
optimization.
The discount rate is used to calculate the Net Present Value (NPV) or Payback Period(PBP) from the cash flow per period observations. The discount rate can be set as a constant discount rate for all periods/observations or it can be set per period/observation. Setting the discount rate per period/observation allows the user to use simulation to simulate the discount rate when it is unknown. If the discount rate does not change per observation, but does change per period, set all of the observations for that period to the same discount rate.
The SetCurrentValue() method is used to define the fixed rate discount rate.
If you are using observations you must call the SetNumberOfPeriods() method to set the number of periods in the portfolio and then call the SetPeriodObservations() method is used to set the observations by period.
The discount rate is used to calculate the Net Present Value (NPV) or Payback Period(PBP) from the cash flow per period observations. The discount rate can be set as a constant discount rate for all periods/observations or it can be set per period/observation. Setting the discount rate per period/observation allows the user to use simulation to simulate the discount rate when it is unknown. If the discount rate does not change per observation, but does change per period, set all of the observations for that period to the same discount rate.
The SetCurrentValue() method is used to define the fixed rate discount rate.
If you are using observations you must call the SetNumberOfPeriods() method to set the number of periods in the portfolio and then call the SetPeriodObservations() method is used to set the observations by period.
-
Constructor Summary
ConstructorDescriptionDefault constructorConstructor that assigns a name to the discount rate variable. -
Method Summary
Modifier and TypeMethodDescriptiondouble
Get discount ratevoid
SetCurrentValue
(double discount) Sets discount rate.void
SetExclusiveRange
(double low, double high) Exclusive range cannot be set for discount variablesvoid
SetLowerBound
(double val) Lower bound cannot be set for discount variablesvoid
SetUpperBound
(double val) Upper bound cannot be set for discount variablesMethods inherited from class com.opttek.optquest.COptQuestProjectVariable
GetNumberOfObservations, GetNumberOfPeriods, GetObservationAt, GetObservations, GetPeriodObservationAt, GetPeriodObservations, SetNumberOfPeriods, SetObservations, SetPeriodObservations
Methods inherited from class com.opttek.optquest.COptQuestVariable
equals, GetDOELowerBound, GetDOEUpperBound, GetExclusiveLowerBoundAt, GetExclusiveUpperBoundAt, getID, GetLowerBound, GetName, GetNumberOfExclusiveRanges, GetStepSize, GetSuggestedValue, GetUpperBound, getVarRange, hashCode, isZeroOne, SetName
-
Constructor Details
-
COptQuestDiscountRateVariable
Constructor that assigns a name to the discount rate variable.- Parameters:
name
- alphanumeric name. Note: the name can contain blanks or special characters. If the variable name is used in a COptQuestStringConstraint equation, the name should be enclosed in square brackets [] in the COptQuestStringConstraint string equation.
-
COptQuestDiscountRateVariable
public COptQuestDiscountRateVariable()Default constructor
-
-
Method Details
-
SetCurrentValue
public void SetCurrentValue(double discount) Sets discount rate.- Parameters:
discount
- discount rate
-
GetCurrentValue
public double GetCurrentValue()Get discount rate- Returns:
- discount rate
-
SetLowerBound
Lower bound cannot be set for discount variables- Overrides:
SetLowerBound
in classCOptQuestVariable
- Parameters:
val
- a value between -pow(2,31) and +pow(2,31)-1- Throws:
COptQuestException
- Invalid method for COptQuestDiscountRateVariable
-
SetUpperBound
Upper bound cannot be set for discount variables- Overrides:
SetUpperBound
in classCOptQuestVariable
- Parameters:
val
- a value between -pow(2,31) and +pow(2,31)-1- Throws:
COptQuestException
- Invalid method for COptQuestDiscountRateVariable
-
SetExclusiveRange
Exclusive range cannot be set for discount variables- Overrides:
SetExclusiveRange
in classCOptQuestVariable
- Parameters:
low
- - any value > low will be excludedhigh
- - any value < high will be excluded- Throws:
COptQuestException
- Invalid method for COptQuestDiscountRateVariable
-