DSRG.VKB
Class QC

java.lang.Object
  |
  +--DSRG.VKB.QC

public class QC
extends java.lang.Object

this class is needed to support the QC-Model. It contains the basic values to compute a QC-Value and the function to actually compute it. Currently the base values are hardcoded, that is soon to change.


Field Summary
private  long CF_IO
          the values for the cost dimensions
private  long CF_M
          the values for the cost dimensions
private  long CF_T
          the values for the cost dimensions
private  double cost_IO
          the tradeoff parameters for the cost dimensions
private  double cost_M
          the tradeoff parameters for the cost dimensions
private  double cost_T
          the tradeoff parameters for the cost dimensions
private  double DD_attr
          the degrees of divergence
private  double DD_ext
          the degrees of divergence
private static double maxCost
          for normalization of the cost, I'll keep a maximum cost that is used in the computation of the complete value and is global for all QC-instances
private  double rho_attr
          the trade-off parameters for the degrees of divergence
private  double rho_cost
          the tradeoff parameters for the two dimensions
private  double rho_ext
          the trade-off parameters for the degrees of divergence
private  double rho_quality
          the tradeoff parameters for the two dimensions
 
Constructor Summary
QC()
          This is the testing constructor.
QC(double my_rho_attr, double my_rho_quality)
          This constructor takes the preset values for the tradeoff factors.
QC(double my_rho_attr, double my_rho_quality, double my_cost_M, double my_cost_T, double my_cost_IO)
          This constructor takes the preset values for the tradeoff factors including the cost tradeoff factors ("unit costs").
 
Method Summary
private  void computeOtherValues()
          This method computes rho_cost and rho_ext from the other two tradeoff values
 long getCFIO()
          returns the Number of I/O-Operations
 long getCFM()
          returns the Number of Messages
 long getCFT()
          returns the Number of Bytes Transferred
 double getCost()
          gets the total cost by multiplying the costs with their cost factors and adding them.
 double getCostIO()
          returns the tradeoff parameter ("unit cost") for the Number of I/O-Operations
 double getCostM()
          returns the tradeoff parameter ("unit cost") for the Number of Messages
 double getCostT()
          returns the tradeoff parameter ("unit cost") for the Number of Bytes Transferred
 double getDDattr()
          returns the Degree of Divergence of the Attributes
 double getDDext()
          returns the Degree of Divergence of the Extent
 double getQCValue()
          compute the total QC-Value from the base values.
 double getQuality()
          gets the total quality by multiplying the degrees of divergence with their tradeoff factors and adding them
 double getRhoAttr()
          returns the tradeoff-parameter for the Degree of Divergence of the Attributes
 double getRhoCost()
          returns the tradeoff-parameter for the total Cost
 double getRhoExt()
          returns the tradeoff-parameter for the Degree of Divergence of the Extent
 double getRhoQuality()
          returns the tradeoff-parameter for the total Degree of Divergence (Quality)
protected  boolean isQCValid()
          checks if the tradeoff parameters are valid (i.e., the pairs add up to one)
static void resetMaxCost()
          resets the max.cost.
 boolean setCF(long myCF_M, long myCF_T, long myCF_IO)
          sets the three cost factors at once.
 boolean setDD(double myDD_attr, double myDD_ext)
          sets the two Degrees of Divergence at once
private  void setRandomValues()
          private method during testing to set some random QC-Values
 java.lang.String toString()
          returns a string representation of the whole QC-object for testing purposes.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

DD_attr

private double DD_attr
the degrees of divergence

DD_ext

private double DD_ext
the degrees of divergence

rho_attr

private double rho_attr
the trade-off parameters for the degrees of divergence

rho_ext

private double rho_ext
the trade-off parameters for the degrees of divergence

CF_T

private long CF_T
the values for the cost dimensions

CF_M

private long CF_M
the values for the cost dimensions

CF_IO

private long CF_IO
the values for the cost dimensions

cost_T

private double cost_T
the tradeoff parameters for the cost dimensions

cost_M

private double cost_M
the tradeoff parameters for the cost dimensions

cost_IO

private double cost_IO
the tradeoff parameters for the cost dimensions

rho_quality

private double rho_quality
the tradeoff parameters for the two dimensions

rho_cost

private double rho_cost
the tradeoff parameters for the two dimensions

maxCost

private static double maxCost
for normalization of the cost, I'll keep a maximum cost that is used in the computation of the complete value and is global for all QC-instances
Constructor Detail

QC

public QC()
This is the testing constructor. Values are hardcoded and random. The total QC-Value always adds up to something between zero and one.

QC

public QC(double my_rho_attr,
          double my_rho_quality)
This constructor takes the preset values for the tradeoff factors. rho_cost and rho_ext are computed from rho_quality and rho_attr, respectively.

QC

public QC(double my_rho_attr,
          double my_rho_quality,
          double my_cost_M,
          double my_cost_T,
          double my_cost_IO)
This constructor takes the preset values for the tradeoff factors including the cost tradeoff factors ("unit costs"). rho_cost and rho_ext are computed from rho_quality and rho_attr, respectively.
This is the final constructor, no random values are assigned here (everything comes from the Version class)
Method Detail

computeOtherValues

private void computeOtherValues()
This method computes rho_cost and rho_ext from the other two tradeoff values

setRandomValues

private void setRandomValues()
private method during testing to set some random QC-Values

getQCValue

public double getQCValue()
compute the total QC-Value from the base values. simple mult-and-add. Test QC-Value (tradeoff parameters, base values) for plausibility.
Returns:
QC-Value. -1 if QC-Value is not valid.

getDDattr

public double getDDattr()
returns the Degree of Divergence of the Attributes

getDDext

public double getDDext()
returns the Degree of Divergence of the Extent

setDD

public boolean setDD(double myDD_attr,
                     double myDD_ext)
sets the two Degrees of Divergence at once
Returns:
QC-Validity check bit

getRhoAttr

public double getRhoAttr()
returns the tradeoff-parameter for the Degree of Divergence of the Attributes

getRhoExt

public double getRhoExt()
returns the tradeoff-parameter for the Degree of Divergence of the Extent

getCFM

public long getCFM()
returns the Number of Messages

getCFT

public long getCFT()
returns the Number of Bytes Transferred

getCFIO

public long getCFIO()
returns the Number of I/O-Operations

setCF

public boolean setCF(long myCF_M,
                     long myCF_T,
                     long myCF_IO)
sets the three cost factors at once.
Returns:
QC-Validity check bit

getCostM

public double getCostM()
returns the tradeoff parameter ("unit cost") for the Number of Messages

getCostT

public double getCostT()
returns the tradeoff parameter ("unit cost") for the Number of Bytes Transferred

getCostIO

public double getCostIO()
returns the tradeoff parameter ("unit cost") for the Number of I/O-Operations

getRhoQuality

public double getRhoQuality()
returns the tradeoff-parameter for the total Degree of Divergence (Quality)

getRhoCost

public double getRhoCost()
returns the tradeoff-parameter for the total Cost

getCost

public double getCost()
gets the total cost by multiplying the costs with their cost factors and adding them. normalizes with maxCost

getQuality

public double getQuality()
gets the total quality by multiplying the degrees of divergence with their tradeoff factors and adding them

isQCValid

protected boolean isQCValid()
checks if the tradeoff parameters are valid (i.e., the pairs add up to one)

toString

public java.lang.String toString()
returns a string representation of the whole QC-object for testing purposes. The format is QC = 1- (0.3 * ( 0.4 * 0.85 + 0.6 * 0.9 ) + 0.7 * (0.0001 * 8000 + 0.0002 * 4000 + 0.0004 * 2500)) or QC = 1- (rho_quality * ( rho_attr * DD_attr + rho_ext * DD_ext ) + rho_cost * (cost_M * CF_M + cost_T * CF_T + cost_IO * CF_IO))
Overrides:
toString in class java.lang.Object

resetMaxCost

public static void resetMaxCost()
resets the max.cost. To be called before the creation of a new set of QC-Values