eu.xtreemos.xosd.resmng.data
Class NodeEvaluationLinear

java.lang.Object
  extended by eu.xtreemos.xosd.resmng.data.NodeEvaluationLinear
All Implemented Interfaces:
INodeEvaluation

public class NodeEvaluationLinear
extends java.lang.Object
implements INodeEvaluation

The class evaluates the score as a linear function. The linear function has a form of: score = k * attributeValue + n.

Author:
matej.artac@xlab.si

Field Summary
protected  double k
          The slope of the linear function.
(package private) static org.apache.log4j.Logger logger
           
protected  double n
          The offset in the y direction of the function.
 
Constructor Summary
NodeEvaluationLinear(double n, double k)
          Initialise the evaluation function to be a linear function.
 
Method Summary
 double getScore(java.lang.Double attributeValue)
          Compute the score of the attribute value typed as Double.
 double getScore(java.lang.Object attributeValue)
          Compute the score of the attribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

static org.apache.log4j.Logger logger

n

protected double n
The offset in the y direction of the function.


k

protected double k
The slope of the linear function.

Constructor Detail

NodeEvaluationLinear

public NodeEvaluationLinear(double n,
                            double k)
Initialise the evaluation function to be a linear function.

Parameters:
n - The offset in the y direction of the function. This is the value of the function for attributeValue = 0;
k - The slope of the function.
Method Detail

getScore

public double getScore(java.lang.Double attributeValue)
Compute the score of the attribute value typed as Double.

Parameters:
attributeValue - The value of the attribute.
Returns:
The score of the attribute.

getScore

public double getScore(java.lang.Object attributeValue)
                throws java.security.InvalidParameterException
Compute the score of the attribute.

Specified by:
getScore in interface INodeEvaluation
Parameters:
attributeValue - The value of the attribute. Must be an instance of Double.
Returns:
The score of the attribute.
Throws:
java.security.InvalidParameterException