prioritizer
Class Pairwise

java.lang.Object
  extended byprioritizer.Pairwise

public class Pairwise
extends java.lang.Object

Defines the Pair Wise comparisons technique used.

Author:
Mikael Jönsson & Per Klingnäs

Nested Class Summary
(package private)  class Pairwise.ComparisonList
          Represents the list containing the comparisons.
(package private)  class Pairwise.Graph
          Defines a graph used for estimating missig comparisons when using incomplete pairwise prioritization
 
Field Summary
private  int allowedPaths
           
private  Pairwise.ComparisonList comparisonList
           
private  double CR
           
private  int currentRow
           
private  Pairwise.Graph graph
           
private  int maxPathsBeforeRandom
           
private  double[] riValues
           
private  RequirementList rList
           
private  double[] rowSums
           
private  double[][] valueMatrix
           
 
Constructor Summary
Pairwise(RequirementList rList)
          Constructor for the Pair Wise comparisons technique.
 
Method Summary
 int backOneStep()
          Backs the list one step and returns the value found there.
 int getAllowedPaths()
          Gets the number of paths to use when using a random sample of paths
 double getCR()
          Gets the current consistency ratio
 java.lang.Object[] getCurrentComparisonRow()
          Returns the current row in the matrix as an array.
 int getCurrentRowIndex()
          Gets the index of the current row.
 int getCurrentValue()
          Gets the value of the current comparison.
 int getMaxPathsBeforeRandom()
          Gets the threshold where no longer all possible paths shall be used, instead the random sample is used.
private  double[] matrixMultiply(double[][] matrix, double[] vector)
          Specialized method for matrix-vector multiplication.
 void prioDone(java.lang.String currentCriteria)
          Sets the values for the current criteria and calculates the priorities using to AHP.
 void reset()
          Resets/restarts the Pair Wise method by clearing all (needed) values.
 void setAllowedPaths(int paths)
          Sets the number of paths to use when using a random sample of paths.
private  void setMatrix()
          Creates an identity matrix.
 void setMaxPathsBeforeRandom(int paths)
          Sets the threshold where no longer all possible paths shall be used, instead the random sample is used.
private  void setupComparisonList()
          Sets up the comparisons and adds them to a list in a random order.
 boolean setValue(double val)
          Sets the value for the current prioritization and checks if there are more comparisons to be done.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

comparisonList

private Pairwise.ComparisonList comparisonList

rList

private RequirementList rList

graph

private Pairwise.Graph graph

currentRow

private int currentRow

riValues

private double[] riValues

rowSums

private double[] rowSums

valueMatrix

private double[][] valueMatrix

CR

private double CR

allowedPaths

private int allowedPaths

maxPathsBeforeRandom

private int maxPathsBeforeRandom
Constructor Detail

Pairwise

public Pairwise(RequirementList rList)
Constructor for the Pair Wise comparisons technique.

Parameters:
rList - the RequirementList containing the Requirements to be prioritized
Method Detail

setAllowedPaths

public void setAllowedPaths(int paths)
Sets the number of paths to use when using a random sample of paths.

Parameters:
paths - the number of paths to allow

getAllowedPaths

public int getAllowedPaths()
Gets the number of paths to use when using a random sample of paths

Returns:
the number of paths to allow

setMaxPathsBeforeRandom

public void setMaxPathsBeforeRandom(int paths)
Sets the threshold where no longer all possible paths shall be used, instead the random sample is used.

Parameters:
paths - the number of paths to allow

getMaxPathsBeforeRandom

public int getMaxPathsBeforeRandom()
Gets the threshold where no longer all possible paths shall be used, instead the random sample is used.

Returns:
the number of paths to allow

matrixMultiply

private double[] matrixMultiply(double[][] matrix,
                                double[] vector)
Specialized method for matrix-vector multiplication.

Parameters:
matrix - the matrix
vector - the vector
Returns:
the resulting vector

setMatrix

private void setMatrix()
Creates an identity matrix.


setupComparisonList

private void setupComparisonList()
Sets up the comparisons and adds them to a list in a random order.


backOneStep

public int backOneStep()
Backs the list one step and returns the value found there.

Returns:
the value at one step back

getCurrentComparisonRow

public java.lang.Object[] getCurrentComparisonRow()
Returns the current row in the matrix as an array.

Returns:
the current row in the matrix

getCurrentRowIndex

public int getCurrentRowIndex()
Gets the index of the current row.

Returns:
the index of the current row

getCurrentValue

public int getCurrentValue()
Gets the value of the current comparison.

Returns:
the value of the current comparison

getCR

public double getCR()
Gets the current consistency ratio

Returns:
the current consistency ratio with two decimals

prioDone

public void prioDone(java.lang.String currentCriteria)
Sets the values for the current criteria and calculates the priorities using to AHP.

Parameters:
currentCriteria - the current criteria

reset

public void reset()
Resets/restarts the Pair Wise method by clearing all (needed) values.


setValue

public boolean setValue(double val)
Sets the value for the current prioritization and checks if there are more comparisons to be done.

Parameters:
val - the value to set
Returns:
true if there are more prioritizations to be done