prioritizer
Class Pairwise.Graph

java.lang.Object
  extended byprioritizer.Pairwise.Graph
Enclosing class:
Pairwise

class Pairwise.Graph
extends java.lang.Object

Defines a graph used for estimating missig comparisons when using incomplete pairwise prioritization


Nested Class Summary
(package private)  class Pairwise.Graph.Arc
          Defines an arc in the graph
(package private)  class Pairwise.Graph.Node
          Defines a node in the graph
(package private)  class Pairwise.Graph.PathValue
          Represents the value of a path in the graph
 
Field Summary
private  int maxPathsFound
           
private  int nbrOfPaths
           
private  Pairwise.Graph.Node[] nodes
           
private  Pairwise.Graph.PathValue pathProduct
           
private  boolean random
           
 
Constructor Summary
Pairwise.Graph(RequirementList rList)
          Constructs the nodes for the graph in which each node represents a requirement
 
Method Summary
 void addArc(Requirement from, Requirement to, double value)
          Adds a comparison represented as a directed arc in the graph
 double calculateGeometricMean(Pairwise.Graph.Node from, Pairwise.Graph.Node to)
          Calculates and returns the geometric mean of a all possible paths between the specified nodes
 double calculateRandomGeometricMean(Pairwise.Graph.Node from, Pairwise.Graph.Node to)
          Calculates and returns the geometric mean of a random sample of paths between the specified nodes
private  void checkForMethodChange()
          Checks if the threshold value has been reached where it becomes inefficient to use all possible paths when estimating a missing path.
 double getArcValue(Requirement from, Requirement to)
          Gets the value of the comparison (arc) between the specified requirements (nodes)
private  void rec(Pairwise.Graph.Node node, Requirement to, double value)
          Recursive algorithm used to calculate the pathproduct for all possible paths from an outgoing arc from the start node.
private  void recRandom(Pairwise.Graph.Node node, Requirement to, double value)
          Recursive algorithm used to calculate the pathproduct for a randomized path from a random outgoing arc from the start node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nodes

private Pairwise.Graph.Node[] nodes

nbrOfPaths

private int nbrOfPaths

maxPathsFound

private int maxPathsFound

pathProduct

private Pairwise.Graph.PathValue pathProduct

random

private boolean random
Constructor Detail

Pairwise.Graph

public Pairwise.Graph(RequirementList rList)
Constructs the nodes for the graph in which each node represents a requirement

Parameters:
rList - the list of requirements to create nodes for
Method Detail

checkForMethodChange

private void checkForMethodChange()
Checks if the threshold value has been reached where it becomes inefficient to use all possible paths when estimating a missing path.


addArc

public void addArc(Requirement from,
                   Requirement to,
                   double value)
Adds a comparison represented as a directed arc in the graph

Parameters:
from - the requirement (node) to add the arc from
to - the requirement (node) to add the arc to
value - the value of the comparison (arc) set by the user

getArcValue

public double getArcValue(Requirement from,
                          Requirement to)
Gets the value of the comparison (arc) between the specified requirements (nodes)

Parameters:
from - the from-requirement (node)
to - the to-requirement (node)
Returns:
the the value of the comparison (arc)

calculateRandomGeometricMean

public double calculateRandomGeometricMean(Pairwise.Graph.Node from,
                                           Pairwise.Graph.Node to)
Calculates and returns the geometric mean of a random sample of paths between the specified nodes

Parameters:
from - the from-node
to - the to-node
Returns:
the calculated geometric mean

calculateGeometricMean

public double calculateGeometricMean(Pairwise.Graph.Node from,
                                     Pairwise.Graph.Node to)
Calculates and returns the geometric mean of a all possible paths between the specified nodes

Parameters:
from - the from-node
to - the to-node
Returns:
the calculated geometric mean

recRandom

private void recRandom(Pairwise.Graph.Node node,
                       Requirement to,
                       double value)
Recursive algorithm used to calculate the pathproduct for a randomized path from a random outgoing arc from the start node.

Parameters:
node - the start node in the recursive call
to - the requirement (node) that is to be found
value - the value of the path so far

rec

private void rec(Pairwise.Graph.Node node,
                 Requirement to,
                 double value)
Recursive algorithm used to calculate the pathproduct for all possible paths from an outgoing arc from the start node.

Parameters:
node - the start node in the recursive call
to - the requirement (node) that is to be found
value - the value of the path so far