dLife Home Page

dlife.rl
Class State

java.lang.Object
  extended by dlife.rl.State
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
StringState

public abstract class State
extends Object
implements Serializable

Base class for representing the state of a TD-based reinforcement learning agent. This class ensures that each State provide hashCode and equals methods that can be used by the QTable class.

Version:
Apr 26, 2011
Author:
Grant Braught, Dickinson College
See Also:
Serialized Form

Constructor Summary
State()
           
 
Method Summary
 boolean equals(Object o)
          Determine if two states are equal.
 int hashCode()
          Return a hash code for this state.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

State

public State()
Method Detail

hashCode

public int hashCode()
Return a hash code for this state. This method must be overridden by all sub-classes.

Objects representing the same state must return the same hash code. It is not necessary that every object representing a different state return a different hash code (this may in fact be impossible). However, performance will be better if distinct states produce distinct hash codes as much as is possible.

Overrides:
hashCode in class Object
Returns:
a hash code for this State.

equals

public boolean equals(Object o)
Determine if two states are equal. This method must be overridden by all sub-classes.

Two States that represent the same physical state of the agent must be considered equal by this method.

Overrides:
equals in class Object
Returns:
true if this State and the State o represent the same state of the agent.

dLife Home Page