public class DEAProblem
extends java.lang.Object
implements java.io.Serializable
Instances of this class are DEA Problems. A DEA Problem Object can hold all the information necessary to define a DEA Problem.
This class needs be instantiated in order to:
Constructor and Description |
---|
DEAProblem(int nbDMUs,
int nbVariables) |
Modifier and Type | Method and Description |
---|---|
double[][] |
getDataMatrix()
#getDataMatrix()
|
double |
getDataMatrix(int dmuIndex,
int varIndex)
Returns a specific variable value from the Data Matrix for the DMU specified.
|
java.lang.String |
getDMUName(int dmuIndex)
Returns the name of a specific DMU.
|
java.lang.String[] |
getDMUNames()
Returns the Names of all the DMUs
|
boolean[] |
getEfficiencyStatus()
Returns the efficiency status for all the DMUs.
|
boolean |
getEfficiencyStatus(int dmuNumber)
Returns the efficiency status for the specific DMU.
|
double |
getlBConvexityConstraintWeight(int dmuIndex)
Gets the weight corresponding to the lower bound convexity constraint on
general, increasing and decreasing models for a speific DMU.
|
double[] |
getlBConvexityConstraintWeights()
Gets the weights corresponding to the lower bound convexity constraint on
general, increasing and decreasing models for all DMUs.
|
EfficiencyType |
getModelEfficiencyType()
This method return the DEA Model Efficiency Type (e.g.
|
java.lang.String |
getModelName() |
ModelOrientation |
getModelOrientation()
This method return the DEA Model Orientation (Input, Output or Non oriented).
|
ReturnsToScale |
getModelRTS()
This method return the DEA Model RTS Type (e.g.
|
ModelType |
getModelType()
Returns Model Type of the DEA Problem (e.g.
|
ModelVariablesType |
getModelVariableTypes()
This method return the DEA Model RTS Type (e.g.
|
int |
getNumberOfDMUs()
Gets the number of DMUs in the DEA Problem
|
int |
getNumberOfInputs()
Gets the number of Inputs of the DEA Problem
|
int |
getNumberOfOutputs()
Gets the number of Outputs of the DEA Problem
|
int |
getNumberOfVariables()
Gets the number of Variables in the DEA Problem
|
double |
getObjective(int dmuNumber)
Returns the Objective value for the specified DMU.
|
double[] |
getObjectives()
Returns the Objectives of all the DMUs.
|
SolverReturnStatus |
getOptimisationStatus()
Returns the DEAProblem optimisation SolverReturnStatus.
|
double[][] |
getProjectionPercentages()
Returns the projection percentages for all DMUs.
|
double[] |
getProjectionPercentages(int dmuNumber)
Returns the projection percentages.
|
double[][] |
getProjections()
Returns the projections for all the DMU
|
double[] |
getProjections(int dmuNumber)
Returns the projections for the specified DMU.
|
int[] |
getRanks(boolean highestIsOne,
RankingType typeOfRanking,
int precision)
Returns the DMU ranks (based on Objectives value)
|
java.util.ArrayList<NonZeroLambda>[] |
getReferenceSet()
Returns the solution Reference Sets (for all DMUs).
|
java.util.ArrayList<NonZeroLambda> |
getReferenceSet(int dmuIndex)
Returns the Reference Set corresponding to dmuIndex.
|
double |
getRTSLowerBound()
Gets the Lower Bound limit for General Return To Scale DEA Models.
|
double |
getRTSUpperBound()
Gets the Upper Bound limit for General Return To Scale DEA Models.
|
double |
getSlack(int dmuNumber,
int varNumber)
Returns the slack value for the specified DMU and Variable Number.
|
double[][] |
getSlacks()
Returns the Slacks for all the DMUs.
|
double[] |
getSlacks(int dmuNumber)
Returns the Slacks for the specified DMU.
|
DEAPSolution |
getSolution()
Returns the problem solution.
|
double[][] |
getTranspose(boolean returnsNegativeTranspose)
Gets the Transpose of the Data Matrix
|
double |
getU0Weight(int dmuIndex)
Gets the u0 weight for a specific DMU (corresponding to the convexity constraint on variable models).
|
double[] |
getU0Weights()
Gets the u0 weights for all the DMUs (corresponding to the convexity constraint on variable models).
|
double |
getuBConvexityConstraintWeight(int dmuIndex)
Gets the weight corresponding to the upper bound convexity constraint on
general, increasing and decreasing models for a specific DMU.
|
double[] |
getuBConvexityConstraintWeights()
Gets the weights corresponding to the upper bound convexity constraint on
general, increasing and decreasing models for all DMUs.
|
java.lang.String |
getVariableName(int varIndex)
Returns the variable name for a specific variable.
|
java.lang.String[] |
getVariableNames()
Returns the Variable Names.
|
VariableOrientation[] |
getVariableOrientation()
Returns the model variable orientation.
|
VariableOrientation |
getVariableOrientation(int varIndex) |
VariableType |
getVariableType(int varIndex)
Gets the Variable type of the Variable specified.
|
VariableType[] |
getVariableTypes()
Returns an array of VariableTypes.
|
double[][] |
getWeight()
Returns the weights for all the DMUs
|
double[] |
getWeight(int dmuNumber)
Returns the weights of the specified DMU.
|
double |
getWeight(int dmuNumber,
int varNumber)
Returns the specific weight value for the specified DMU and Variable number.
|
void |
setDataMatrix(double[][] dMatrix)
Sets the whole Data Matrix.
|
void |
setDataMatrix(double value,
int dmuIndex,
int varIndex)
Sets a value for a specific DMU.
|
void |
setDMUName(java.lang.String dmuName,
int dmuIndex)
Returns a DMU Name for the the DMU Number specified.
|
void |
setDMUNames(java.lang.String[] dmuNames)
Sets DMU Names of all DMUs
|
void |
setModelName(java.lang.String modName) |
void |
setModelType(ModelType modType)
Sets type of DEA Problem Model (e.g.
|
void |
setRTSLowerBound(double lowerB)
Sets the Lower Bound limit for General Return To Scale DEA Models.
|
void |
setRTSUpperBound(double upperB)
Sets the Upper Bound limit for General Return To Scale DEA Models.
|
void |
setVariableName(java.lang.String varName,
int varIndex)
Sets the name of the variable at position VariableNumber in the Variable Names Array.
|
void |
setVariableNames(java.lang.String[] varNames)
Sets all the Variable names.
|
void |
setVariableOrientation(int varIndex,
VariableOrientation varOrientation)
Sets the model variable orientation for the specific variable at varIndex.
|
void |
setVariableOrientations(VariableOrientation[] varOrientations)
Sets the model Variable Orientations
|
void |
setVariableType(int varIndex,
VariableType varType)
Sets the VariableType for the specified Variable.
|
void |
setVariableTypes(VariableType[] varTypes)
Sets the variable type for all the variables.
|
void |
solve()
Solves the specific DEA Problem.
|
void |
solveOne(int dmuIndex)
Solves the DEA Problem for the given DMU Index.
|
void |
solveOne(int dmuIndex,
double[][] negativeTransposedMatrix)
Solves the DEA Problem for the given DMU Index.
|
public DEAProblem(int nbDMUs, int nbVariables)
nbDMUs
- The number of DMUs in the DEA problem to solve.nbVariables
- The number of variables in the DEA Problem to solve.public ModelType getModelType()
public void setModelType(ModelType modType)
modType
- The DEA Problem type.public java.lang.String[] getDMUNames()
public java.lang.String getDMUName(int dmuIndex) throws java.lang.IndexOutOfBoundsException
dmuIndex
- The number of the DMU (position) in the Array.java.lang.IndexOutOfBoundsException
public void setDMUNames(java.lang.String[] dmuNames)
dmuNames
- The String[] of the DMU Names.public void setDMUName(java.lang.String dmuName, int dmuIndex) throws java.lang.IndexOutOfBoundsException
dmuName
- The Name of the DMU.dmuIndex
- The DMU Number (position in the array) where to put the name.java.lang.IndexOutOfBoundsException
public java.lang.String[] getVariableNames()
public java.lang.String getVariableName(int varIndex) throws java.lang.IndexOutOfBoundsException
varIndex
- The Variable Number in the variable array.java.lang.IndexOutOfBoundsException
public void setVariableNames(java.lang.String[] varNames)
varNames
- A String[] of Variable Names.public void setVariableName(java.lang.String varName, int varIndex) throws java.lang.IndexOutOfBoundsException
varName
- The Name of the Variable.varIndex
- The Variable position in the Variable Array.java.lang.IndexOutOfBoundsException
public VariableType[] getVariableTypes()
public VariableType getVariableType(int varIndex) throws java.lang.IndexOutOfBoundsException
varIndex
- The position of the variable in the Variable Array.java.lang.IndexOutOfBoundsException
public void setVariableTypes(VariableType[] varTypes)
varTypes
- An array of VariableType.public void setVariableType(int varIndex, VariableType varType) throws java.lang.IndexOutOfBoundsException
varIndex
- The position of the variable in the Variable Array.varType
- The VariableType of the specified variable.java.lang.IndexOutOfBoundsException
public void setVariableOrientations(VariableOrientation[] varOrientations)
varOrientations
- the VariableOrientation[] array.public void setVariableOrientation(int varIndex, VariableOrientation varOrientation)
varIndex
- the variable indexvarOrientation
- the variable orientation typepublic VariableOrientation[] getVariableOrientation()
public VariableOrientation getVariableOrientation(int varIndex)
varIndex
- the variable indexpublic double[][] getDataMatrix()
Returns the matrix of values.
public double getDataMatrix(int dmuIndex, int varIndex)
dmuIndex
- The number of DMU in the DMU arrayvarIndex
- The number of the variable in the Variable Arraypublic void setDataMatrix(double[][] dMatrix)
dMatrix
- The double [NbDMUs] [NbVariable] array of the problem values.public void setDataMatrix(double value, int dmuIndex, int varIndex) throws java.lang.IndexOutOfBoundsException
value
- The specific value to set.dmuIndex
- The DMU Number for which to set the value.varIndex
- The Variable Number for which to set the value.java.lang.IndexOutOfBoundsException
public void setRTSLowerBound(double lowerB) throws InvalidPropertyValueException
lowerB
- A double corresponding to the General RTS Lower Bound Limit.InvalidPropertyValueException
public double getRTSLowerBound()
public void setRTSUpperBound(double upperB) throws InvalidPropertyValueException
upperB
- A double corresponding to the General RTS Upper Bound Limit.InvalidPropertyValueException
public double getRTSUpperBound()
public void setModelName(java.lang.String modName)
public java.lang.String getModelName()
public int getNumberOfDMUs()
public int getNumberOfOutputs() throws MissingDataException
MissingDataException
public int getNumberOfInputs() throws MissingDataException
MissingDataException
public int getNumberOfVariables()
public double[][] getTranspose(boolean returnsNegativeTranspose) throws MissingDataException
returnsNegativeTranspose
- A boolean. If true, all values of the TransposedMatrix are timed by -1.MissingDataException
public ModelOrientation getModelOrientation() throws MissingDataException
MissingDataException
- Thrown if the ModelType is not set.public EfficiencyType getModelEfficiencyType() throws MissingDataException
MissingDataException
- Thrown if the ModelType is not set.public ReturnsToScale getModelRTS() throws MissingDataException
MissingDataException
- Thrown if the ModelType is not set.public ModelVariablesType getModelVariableTypes() throws MissingDataException
MissingDataException
- Thrown if the ModelType is not set.public void solve() throws MissingDataException, InconsistentNoOfDMUsException, InconsistentNoOfVariablesException, DEASolverException, ProblemNotSolvedProperlyException
The Model needs to have all the required parameters in order for this to work.
There is no check at present, if the parameters are incorrect, the library will simply crash.
The switch in the solve() method call a separate method for each model. Each of these method returns a DEAPSolution object which is passed to this._Solution (and can then be accessed using the getSolutionItems methods).
public void solveOne(int dmuIndex, double[][] negativeTransposedMatrix) throws InconsistentNoOfVariablesException, InconsistentNoOfDMUsException, MissingDataException, ProblemNotSolvedProperlyException, DEASolverException
It is necessary (for optimisation reasons) to provide the negative transposed matrix of the data matrix using the DEAProblem method getTranspose(true);. The method will still work if a null transposed matrix is sent, or if a positive transposed matrix is given instead although this will result in longer optimisation times!
dmuIndex
- InconsistentNoOfVariablesException
InconsistentNoOfDMUsException
MissingDataException
ProblemNotSolvedProperlyException
DEASolverException
public void solveOne(int dmuIndex) throws InconsistentNoOfVariablesException, InconsistentNoOfDMUsException, MissingDataException, ProblemNotSolvedProperlyException, DEASolverException
For better performance, create the negative transposed of the data matrix and call the SolveOne(int, double[][]) method).
dmuIndex
- InconsistentNoOfVariablesException
InconsistentNoOfDMUsException
MissingDataException
ProblemNotSolvedProperlyException
DEASolverException
public DEAPSolution getSolution()
Take extra care when calling this method of NOT corrupting a problem solution.
public SolverReturnStatus getOptimisationStatus()
public double[] getObjectives() throws ProblemNotSolvedProperlyException
ProblemNotSolvedProperlyException
public double getObjective(int dmuNumber) throws ProblemNotSolvedProperlyException
dmuNumber
- The number of the DMU in the Objective Array.ProblemNotSolvedProperlyException
public boolean[] getEfficiencyStatus() throws ProblemNotSolvedProperlyException
ProblemNotSolvedProperlyException
public boolean getEfficiencyStatus(int dmuNumber) throws ProblemNotSolvedProperlyException
dmuNumber
- ProblemNotSolvedProperlyException
public double[] getSlacks(int dmuNumber) throws ProblemNotSolvedProperlyException
dmuNumber
- The number of the DMU.ProblemNotSolvedProperlyException
public double getSlack(int dmuNumber, int varNumber) throws ProblemNotSolvedProperlyException
dmuNumber
- The number of the DMUvarNumber
- The Number of the VariableProblemNotSolvedProperlyException
public double[][] getSlacks() throws ProblemNotSolvedProperlyException
ProblemNotSolvedProperlyException
public double[] getWeight(int dmuNumber) throws ProblemNotSolvedProperlyException
dmuNumber
- The Number of the DMU.ProblemNotSolvedProperlyException
public double getWeight(int dmuNumber, int varNumber) throws ProblemNotSolvedProperlyException
dmuNumber
- The number of the DMUvarNumber
- The number of the VariableProblemNotSolvedProperlyException
public double[][] getWeight() throws ProblemNotSolvedProperlyException
ProblemNotSolvedProperlyException
public double[] getProjections(int dmuNumber) throws ProblemNotSolvedProperlyException
dmuNumber
- The number of the DMUProblemNotSolvedProperlyException
public double[][] getProjections() throws ProblemNotSolvedProperlyException
ProblemNotSolvedProperlyException
public double[] getProjectionPercentages(int dmuNumber) throws ProblemNotSolvedProperlyException
dmuNumber
- The DMU NumberProblemNotSolvedProperlyException
public double[][] getProjectionPercentages() throws ProblemNotSolvedProperlyException
ProblemNotSolvedProperlyException
public int[] getRanks(boolean highestIsOne, RankingType typeOfRanking, int precision) throws ProblemNotSolvedProperlyException
highestIsOne
- A boolean. If true the highest value has rank '1' (first). Should generally be 'true'.typeOfRanking
- The type of ranking to use. Should generally be 'STANDARD'.precision
- An int value to specify at which decimal place the scores need to be rounded up prior to been ranked.
This is important as most of the scores of the 'efficient' DMUs are not 1 but some value very close to 1 (e.g. 1.00000000000002).
All precisions between 0 and 16 are taken into account, any other int value would leave the scores unchanged.ProblemNotSolvedProperlyException
public java.util.ArrayList<NonZeroLambda>[] getReferenceSet() throws ProblemNotSolvedProperlyException
ProblemNotSolvedProperlyException
public java.util.ArrayList<NonZeroLambda> getReferenceSet(int dmuIndex) throws ProblemNotSolvedProperlyException
dmuIndex
- ProblemNotSolvedProperlyException
public double[] getU0Weights() throws IncompatibleModelTypeException, ProblemNotSolvedProperlyException
ProblemNotSolvedProperlyException
MissingDataException
IncompatibleModelTypeException
public double getU0Weight(int dmuIndex) throws IncompatibleModelTypeException, ProblemNotSolvedProperlyException
dmuIndex
- the index of the DMU to get the u0 weight forIncompatibleModelTypeException
ProblemNotSolvedProperlyException
public double[] getlBConvexityConstraintWeights() throws IncompatibleModelTypeException, ProblemNotSolvedProperlyException
IncompatibleModelTypeException
ProblemNotSolvedProperlyException
public double getlBConvexityConstraintWeight(int dmuIndex) throws IncompatibleModelTypeException, ProblemNotSolvedProperlyException
dmuIndex
- IncompatibleModelTypeException
ProblemNotSolvedProperlyException
public double[] getuBConvexityConstraintWeights() throws IncompatibleModelTypeException, ProblemNotSolvedProperlyException
IncompatibleModelTypeException
ProblemNotSolvedProperlyException
public double getuBConvexityConstraintWeight(int dmuIndex) throws IncompatibleModelTypeException, ProblemNotSolvedProperlyException
dmuIndex
- the index of the DMU to get the u0 weight forIncompatibleModelTypeException
ProblemNotSolvedProperlyException