edu.umich.soar.hpp
Class HPPMultiVariable

java.lang.Object
  extended by edu.umich.soar.hpp.HPPVariable
      extended by edu.umich.soar.hpp.HPPMultiVariable
All Implemented Interfaces:
java.lang.Comparable<HPPVariable>
Direct Known Subclasses:
HPPBinaryVariable

public class HPPMultiVariable
extends HPPVariable

Variable whose values can be represented with a discrete conditional-probability table (CPT). For convenience, supports a default value for CPT fall-through.


Constructor Summary
HPPMultiVariable(java.lang.String name, java.lang.String defaultValue)
          Basic constructor - empty CPT
HPPMultiVariable(java.lang.String name, java.lang.String defaultValue, HPPCPTEntry[] cpt)
          Advanced constructor to initialize the CPT
 
Method Summary
protected  void addCPTEntries(HPPCPTEntry[] cpt)
          For convenience, supports appending multiple entries to the CPT
 void addCPTEntry(HPPCPTEntry newEntry)
          Supports appending to the CPT
 java.util.Iterator<HPPCPTEntry> getCPT()
          Supports read-only access to the CPT [via entries]
 java.lang.String getDefaultValue()
          Supports read-only access to the default value
 java.lang.String getType()
          A variable's type is just a string (used for console debugging)
 
Methods inherited from class edu.umich.soar.hpp.HPPVariable
compareTo, getName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HPPMultiVariable

public HPPMultiVariable(java.lang.String name,
                        java.lang.String defaultValue)
Basic constructor - empty CPT

Parameters:
name - variable name
defaultValue - default value, or null for none

HPPMultiVariable

public HPPMultiVariable(java.lang.String name,
                        java.lang.String defaultValue,
                        HPPCPTEntry[] cpt)
Advanced constructor to initialize the CPT

Parameters:
name - variable name
defaultValue - default value, or null fo rnone
cpt - initial cpt entries
Method Detail

getDefaultValue

public java.lang.String getDefaultValue()
Supports read-only access to the default value

Returns:
default value if no CPT match

getCPT

public java.util.Iterator<HPPCPTEntry> getCPT()
Supports read-only access to the CPT [via entries]

Returns:
iterator to CPT entry list

addCPTEntry

public void addCPTEntry(HPPCPTEntry newEntry)
Supports appending to the CPT

Parameters:
newEntry - entry to add to the CPT

addCPTEntries

protected void addCPTEntries(HPPCPTEntry[] cpt)
For convenience, supports appending multiple entries to the CPT

Parameters:
cpt - array of entries to add to the CPT

getType

public java.lang.String getType()
Description copied from class: HPPVariable
A variable's type is just a string (used for console debugging)

Specified by:
getType in class HPPVariable
Returns:
variable type