Package com.opttek.optquest
Class COptQuestPortfolioObjective
java.lang.Object
com.opttek.optquest.COptQuestObjective
com.opttek.optquest.COptQuestSingleObjective
com.opttek.optquest.COptQuestPortfolioObjective
The COptQuestPortfolioObjective class defines the objective of an optimization
as minimizing or maximizing a statistic on a measure. The user must define
COptQuestProjectVariables with observations or period observations.
-
Constructor Summary
ConstructorDescriptionDefault constructorConstructor that assigns a name to the portfolio objective. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the portfolio measure set by the SetPortfolioMeasure() method.int
Returns the portfolio statistic defined by the SetPortfolioStatistic() method.double
Returns the statistic value defined by the SetPortfolioStatistic() method.boolean
IsLinear()
Returns true if the objective is a linear function.void
SetPortfolioMeasure
(int measure) Defines the measure for the portfolio objective.void
SetPortfolioStatistic
(int statistic, double statisticValue) Defines the statistic for the portfolio objective.Methods inherited from class com.opttek.optquest.COptQuestSingleObjective
GetReplicationConfidenceErrorPercent, GetReplicationConfidenceLevel, GetReplicationConfidenceType, GetReplicationStatistic, GetReplicationStatisticValue, SetReplicationConfidence, SetReplicationStatistic
Methods inherited from class com.opttek.optquest.COptQuestObjective
equals, GetName, hashCode, IsMaximize, IsMinimize, SetMaximize, SetMinimize, SetName
-
Constructor Details
-
COptQuestPortfolioObjective
public COptQuestPortfolioObjective()Default constructor -
COptQuestPortfolioObjective
Constructor that assigns a name to the portfolio objective.
-
-
Method Details
-
IsLinear
public boolean IsLinear()Description copied from class:COptQuestObjective
Returns true if the objective is a linear function. This is true if the user defined the objective as a COptQuestObjectiveFunction or if the user defined the objective as a COptQuestStringObjective and the string expression is a linear expression using decision variables and coefficients.- Overrides:
IsLinear
in classCOptQuestObjective
- Returns:
- true if the objective is a linear function of the decision variables.
-
SetPortfolioStatistic
Defines the statistic for the portfolio objective. The statistics OCLP_PERCENTILE, OCLP_SEMI1STDDEV, OCLP_SEMI2STDDEV and OCLP_PROBABILITY require the statisticValue to be set. This value is ignored for all other statistics.- Parameters:
statistic
-- OCLP_MEAN = 1
- OCLP_MEDIAN = 2
- OCLP_PERCENTILE = 3
- OCLP_STDDEV = 4
- OCLP_SEMI1STDDEV = 5
- OCLP_VARIANCE = 6
- OCLP_SEMI1VARIANCE = 7
- OCLP_COEFFOFVAR = 8
- OCLP_COEFFOFSEMI1VAR = 9
- OCLP_PROBABILITY = 10
- OCLP_SEMI2STDDEV = 11
- OCLP_SEMI2VARIANCE = 12
- OCLP_COEFFOFSEMI2VAR = 13
statisticValue
- - target value for OCLP_PERCENTILE, OCLP_SEMI1STDDEV, OCLP_SEMI2STDDEV and OCLP_PROBABILITY- Throws:
COptQuestException
- if the statistic or statistic value are invalid.
-
GetPortfolioStatistic
public int GetPortfolioStatistic()Returns the portfolio statistic defined by the SetPortfolioStatistic() method.- Returns:
- statistic
- OCLP_MEAN = 1
- OCLP_MEDIAN = 2
- OCLP_PERCENTILE = 3
- OCLP_STDDEV = 4
- OCLP_SEMI1STDDEV = 5
- OCLP_VARIANCE = 6
- OCLP_SEMI1VARIANCE = 7
- OCLP_COEFFOFVAR = 8
- OCLP_COEFFOFSEMI1VAR = 9
- OCLP_PROBABILITY = 10
- OCLP_SEMI2STDDEV = 11
- OCLP_SEMI2VARIANCE = 12
- OCLP_COEFFOFSEMI2VAR = 13
-
GetPortfolioStatisticValue
public double GetPortfolioStatisticValue()Returns the statistic value defined by the SetPortfolioStatistic() method. The statistics OCLP_PERCENTILE, OCLP_SEMI1STDDEV, OCLP_SEMI2STDDEV and OCLP_PROBABILITY require the statisticValue to be set.- Returns:
- the target value for OCLP_PERCENTILE, OCLP_SEMI1STDDEV, OCLP_SEMI2STDDEV and OCLP_PROBABILITY. Returns 0 for all other statistics.
-
SetPortfolioMeasure
Defines the measure for the portfolio objective.- Parameters:
measure
-- OCLP_NPV = 1
- OCLP_IRR = 2
- OCLP_PBP = 3
- Throws:
COptQuestException
- if the measure is invalid.
-
GetPortfolioMeasure
public int GetPortfolioMeasure()Returns the portfolio measure set by the SetPortfolioMeasure() method.- Returns:
- the integer value that identifies the portfolio measure
- OCLP_NPV = 1
- OCLP_IRR = 2
- OCLP_PBP = 3
-