hu.birot.OTKit.dataType
Class Comparison

java.lang.Object
  extended by hu.birot.OTKit.dataType.Comparison

public class Comparison
extends java.lang.Object

A data structure that contains the typical result of comparing two candidates in Optimality Theory.

When comparing two candidates, one of them is better (Candidate Comparison.better), the other one is worse (Candidate Comparison.worse). There is a constraint that contains the decisive violations ("highest ranked constraint with uncanceled violation marks" or "fatal constraint"; Constraint Comparison.fatal). Finally, the difference between how the two candidates violate the fatal constraint ("number of uncanceled marks", or the difference between the two violation levels; double Comparison.difference) may also play a role.

Moreover, the boolean values Comparison.isBetterThan, Comparison.isWorseThan and Comparison.areEquivalent can also be useful.

Methods in otBuildingBlocks.Eval return instances of the class Comparison, containing all possibly important information in one. The goal is to minimize the number of times that the method Constraint.value(Candidate) has to be called.

In practice, this method is mutable. But it is meant not to mute it...

See Also:
Eval

Field Summary
 boolean areEquivalent
          True if the two candidates are equally harmonic; if they are assigned the same violations for all constraints.
 Candidate better
          The better candidate after the comparison.
 double difference
          The difference in Harmony of the two candidates.
 Constraint fatal
          The highest ranked constraint with uncanceled violation marks.
 boolean isBetterThan
          True if the first candidate is more harmonic than the second one.
 boolean isWorseThan
          True if the first candidate is less harmonic than the second one.
 Candidate worse
          The less optimal candidate after the comparison.
 
Constructor Summary
Comparison()
           
 
Method Summary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

better

public Candidate better
The better candidate after the comparison.


worse

public Candidate worse
The less optimal candidate after the comparison.


fatal

public Constraint fatal
The highest ranked constraint with uncanceled violation marks. In other words, the highest ranked constraint that assigns a different violation to the two candidates.


difference

public double difference
The difference in Harmony of the two candidates. For instance, the difference of the violations of the fatal constraint.


isBetterThan

public boolean isBetterThan
True if the first candidate is more harmonic than the second one.


isWorseThan

public boolean isWorseThan
True if the first candidate is less harmonic than the second one.


areEquivalent

public boolean areEquivalent
True if the two candidates are equally harmonic; if they are assigned the same violations for all constraints.

Constructor Detail

Comparison

public Comparison()