eaLib API Docs
Last Modified : January 7 2002

mss.ea.eval
Class CompoundScore

java.lang.Object
  |
  +--mss.ea.eval.AbstractScore
        |
        +--mss.ea.eval.CompoundScore
All Implemented Interfaces:
java.lang.Comparable, Score, java.io.Serializable

public class CompoundScore
extends AbstractScore

Compound score. This score is a compound of other scores. The comparison is done by comparators for each of the contained scores. This score acts like the score vector used in multi-objective optimization problems.

Since:
0.2.1
Version:
$Revision: 1.6 $ $Date: 2001/12/03 16:46:52 $
Author:
Andreas Rummler
See Also:
Serialized Form

Field Summary
protected  java.util.ArrayList comparators
          Array list with score comparators.
protected  java.util.ArrayList compound
          Array list with scores.
 
Fields inherited from interface mss.ea.core.Score
serialVersionUID
 
Constructor Summary
CompoundScore()
          Constructor without parameters.
CompoundScore(Score s)
          Constructor.
CompoundScore(Score s, ScoreComparator sc)
          Constructor with score and comparator.
 
Method Summary
 void addScore(Score s)
          Adds a new score to the interal list.
 void addScore(Score s, ScoreComparator sc)
          Adds a new score and the appropriate comparator to the interal list.
 int compareTo(java.lang.Object o)
          Compares this score to another score.
 ScoreComparator getComparator(int index)
          Gets a comparator from the internal list.
 Score getScore(int index)
          Gets a score from the internal list.
 int size()
          Returns the number of contained scores.
 java.lang.String toString()
          Returns a representation of this compound score as a string.
 java.lang.Object value()
          Returns the array list with the scores.
 
Methods inherited from class mss.ea.eval.AbstractScore
isBetter, isEqual, isWorse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

compound

protected java.util.ArrayList compound
Array list with scores.

comparators

protected java.util.ArrayList comparators
Array list with score comparators.
Constructor Detail

CompoundScore

public CompoundScore()
Constructor without parameters.

CompoundScore

public CompoundScore(Score s)
Constructor. This adds the given score to the interal list and creates a new default score comparator.
Parameters:
s - score

CompoundScore

public CompoundScore(Score s,
                     ScoreComparator sc)
Constructor with score and comparator. Both are added to the internal lists.
Parameters:
s - score
sc - appropriate score comparator
Method Detail

addScore

public void addScore(Score s)
Adds a new score to the interal list. This method creates a default score comparator for the given score.
Parameters:
s - score to add

addScore

public void addScore(Score s,
                     ScoreComparator sc)
Adds a new score and the appropriate comparator to the interal list.
Parameters:
s - score to add
sc - appropriate score comparator

getScore

public Score getScore(int index)
Gets a score from the internal list.
Parameters:
index - index of the score
Returns:
score from the list

getComparator

public ScoreComparator getComparator(int index)
Gets a comparator from the internal list.
Parameters:
index - index of the score comparator
Returns:
score comparator from internal list

value

public java.lang.Object value()
Returns the array list with the scores.
Overrides:
value in class AbstractScore
Returns:
array list containing scores

size

public int size()
Returns the number of contained scores.
Returns:
number of contained scores

compareTo

public int compareTo(java.lang.Object o)
Compares this score to another score. This method returns 0 the comparison has a indifferent result. It returns -2 resp. -1 if this score strongly resp. weakly dominates the other score. It returns 2 resp. 1 if this score is strongly resp. weakly dominated by the other score.
Overrides:
compareTo in class AbstractScore
Parameters:
o - other compound score
Returns:
result of comparison

toString

public java.lang.String toString()
Returns a representation of this compound score as a string.
Overrides:
toString in class java.lang.Object
Returns:
string representation

eaLib API Docs
Last Modified : January 7 2002

Copyright © 2000-2001 Technical University of Ilmenau, Department ESS