edu.indiana.iucbrf.domain
Class ProblemEquivalenceClass

java.lang.Object
  extended by edu.indiana.iucbrf.domain.ProblemEquivalenceClass
All Implemented Interfaces:
java.io.Serializable

public class ProblemEquivalenceClass
extends java.lang.Object
implements java.io.Serializable

Used for generated domains to divide up the problem space for Domain.getReferenceSolution(). See that method for additional details.

See Also:
Serialized Form

Constructor Summary
protected ProblemEquivalenceClass()
           
  ProblemEquivalenceClass(Problem prototypeProblem, DoubleCollection weights, Domain domain)
          Creates new ProblemEquivalenceClass.
  ProblemEquivalenceClass(Problem prototypeProblem, DoubleCollection weights, Domain domain, double booleanSolutionCutoff)
          Creates new ProblemEquivalenceClass.
 
Method Summary
protected  Solution applyTo(Problem p)
          Apply this equivalence class to a given problem, by taking a linear combination of the weights and the problem feature vector.
protected  Solution applyTo(Problem p, double booleanSolutionCutoff)
           
protected  double applyToHelper(Problem p)
           
 boolean equals(java.lang.Object other)
          Determine if this ProblemEquivalenceClass is equal to another.
 Domain getDomain()
          Get the domain in which this equivalence class exists.
 Problem getPrototypeProblem()
          Get the prototype problem for this equivalence class.
 DoubleCollection getWeights()
          Get the weights for the reference solution associated with this equivalence class.
protected  void setDomain(Domain domain)
           
 java.lang.String toString()
          Get a String representation of this ProblemEquivalenceClass.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProblemEquivalenceClass

protected ProblemEquivalenceClass()

ProblemEquivalenceClass

public ProblemEquivalenceClass(Problem prototypeProblem,
                               DoubleCollection weights,
                               Domain domain,
                               double booleanSolutionCutoff)
Creates new ProblemEquivalenceClass.


ProblemEquivalenceClass

public ProblemEquivalenceClass(Problem prototypeProblem,
                               DoubleCollection weights,
                               Domain domain)
Creates new ProblemEquivalenceClass.

Method Detail

getPrototypeProblem

public Problem getPrototypeProblem()
Get the prototype problem for this equivalence class.


getWeights

public DoubleCollection getWeights()
Get the weights for the reference solution associated with this equivalence class.


getDomain

public Domain getDomain()
Get the domain in which this equivalence class exists.


setDomain

protected void setDomain(Domain domain)

applyTo

protected Solution applyTo(Problem p,
                           double booleanSolutionCutoff)

applyTo

protected Solution applyTo(Problem p)
Apply this equivalence class to a given problem, by taking a linear combination of the weights and the problem feature vector. Requires DoubleRepresentable!!!


applyToHelper

protected double applyToHelper(Problem p)

toString

public java.lang.String toString()
Get a String representation of this ProblemEquivalenceClass.

Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object other)
Determine if this ProblemEquivalenceClass is equal to another. Two ProblemEquivalenceClasses are equal if their weights are equal, and their prototype problems are equal.
Note that this method ignores the domain itself, otherwise there would be an infinite mutual recursion of ProblemEquivalenceClass.equals() and Domain.equals().

Overrides:
equals in class java.lang.Object