net.sf.bddbddb.order
Class TrialInfo

java.lang.Object
  extended by net.sf.bddbddb.order.TrialInfo
All Implemented Interfaces:
java.lang.Comparable

public class TrialInfo
extends java.lang.Object
implements java.lang.Comparable

Information about a particular trial.

Version:
$Id: TrialInfo.java 551 2005-05-19 01:53:49Z cs343 $
Author:
John Whaley

Field Summary
 long cost
          Cost of this trial.
 EpisodeCollection.Episode episode
          Collection that contains this trial.
 Order order
          Order tried.
 TrialPrediction pred
          The predicted results for this trial.
static java.lang.String PREDICTION_VAR1
           
static java.lang.String PREDICTION_VAR2
           
 long timestamp
           
 
Constructor Summary
TrialInfo(Order o, TrialPrediction p, long c, EpisodeCollection.Episode ep, long timestamp)
          Construct a new TrialInfo.
 
Method Summary
 int compareTo(java.lang.Object arg0)
           
 int compareTo(TrialInfo that)
          Comparison operator for TrialInfo objects.
static TrialInfo fromXMLElement(org.jdom.Element e, java.util.Map nameToVar, EpisodeCollection.Episode ep)
           
 EpisodeCollection getCollection()
           
 boolean isMax()
           
 java.lang.String toString()
           
 org.jdom.Element toXMLElement()
          Returns this TrialInfo as an XML element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

order

public Order order
Order tried.


cost

public long cost
Cost of this trial.


episode

public EpisodeCollection.Episode episode
Collection that contains this trial.


pred

public TrialPrediction pred
The predicted results for this trial.


timestamp

public long timestamp

PREDICTION_VAR1

public static java.lang.String PREDICTION_VAR1

PREDICTION_VAR2

public static java.lang.String PREDICTION_VAR2
Constructor Detail

TrialInfo

public TrialInfo(Order o,
                 TrialPrediction p,
                 long c,
                 EpisodeCollection.Episode ep,
                 long timestamp)
Construct a new TrialInfo.

Parameters:
o - order
p - predict value for this trial
c - cost
Method Detail

getCollection

public EpisodeCollection getCollection()
Returns:
Returns the trial collection that this is a member of.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

compareTo

public int compareTo(java.lang.Object arg0)
Specified by:
compareTo in interface java.lang.Comparable

compareTo

public int compareTo(TrialInfo that)
Comparison operator for TrialInfo objects. Comparison is based on cost. If the cost is equal, we compare the order lexigraphically.

Parameters:
that - TrialInfo to compare to
Returns:
-1, 0, or 1 if this TrialInfo is less than, equal to, or greater than the other

isMax

public boolean isMax()

toXMLElement

public org.jdom.Element toXMLElement()
Returns this TrialInfo as an XML element.

Returns:
XML element

fromXMLElement

public static TrialInfo fromXMLElement(org.jdom.Element e,
                                       java.util.Map nameToVar,
                                       EpisodeCollection.Episode ep)


Copyright © 2004-2008 Stanford SUIF Compiler Group. All Rights Reserved.