versus.meeting
Class RLMeetingWorld

java.lang.Object
  |
  +--versus.meeting.RLMeetingWorld
All Implemented Interfaces:
RLWorld

public class RLMeetingWorld
extends java.lang.Object
implements RLWorld

Implementation of meeting world for reinforcement learning environment.

Version:
$Id: RLMeetingWorld.java,v 1.8 2003/08/01 00:39:49 glchen Exp $
Author:
Guanling Chen

Field Summary
(package private)  int _action
           
(package private)  int _actionTime
           
(package private)  RLMeetingAgent _agent
           
(package private)  int _currentTime
           
(package private)  boolean _endState
           
(package private)  int _holding
           
(package private)  int _numMoving
           
(package private)  int[] _state
           
(package private)  int _timeMoving
           
(package private) static double INIT_VALS
           
(package private) static int NUM_ACTIONS
           
(package private) static int NUM_OBJECTS
           
(package private) static int NUM_STATES
           
 
Constructor Summary
RLMeetingWorld(RLMeetingAgent agent)
           
 
Method Summary
 boolean endState()
          Returns true if current state is absorbing state, false if not.
 int[] getDimension()
          Returns the array containing the information about the number of states in each dimension ( [0] - [array.length - 2] ) and the number of possible actions ( [array.length - 1] ).
 double getInitValues()
          Gets the initial value for the policy.
 int[] getNextState(int action)
          Returns a new instance of the new state that results from applying the given action to the current state.
 double getReward()
          Returns the value for the last reward received from calling the method getNextState( int action ).
 int[] resetState()
          Resets the current state to the start position and returns that state.
 void setEndState(boolean end)
           
 boolean validAction(int action)
          Returns true if the given action is a valid action on the current state, false if not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NUM_OBJECTS

static final int NUM_OBJECTS
See Also:
Constant Field Values

NUM_ACTIONS

static final int NUM_ACTIONS
See Also:
Constant Field Values

INIT_VALS

static final double INIT_VALS
See Also:
Constant Field Values

NUM_STATES

static final int NUM_STATES
See Also:
Constant Field Values

_agent

RLMeetingAgent _agent

_state

int[] _state

_endState

boolean _endState

_action

int _action

_actionTime

int _actionTime

_holding

int _holding

_numMoving

int _numMoving

_timeMoving

int _timeMoving

_currentTime

int _currentTime
Constructor Detail

RLMeetingWorld

public RLMeetingWorld(RLMeetingAgent agent)
Method Detail

getDimension

public int[] getDimension()
Description copied from interface: RLWorld
Returns the array containing the information about the number of states in each dimension ( [0] - [array.length - 2] ) and the number of possible actions ( [array.length - 1] ).

Specified by:
getDimension in interface RLWorld

getNextState

public int[] getNextState(int action)
Description copied from interface: RLWorld
Returns a new instance of the new state that results from applying the given action to the current state.

Specified by:
getNextState in interface RLWorld

getReward

public double getReward()
Description copied from interface: RLWorld
Returns the value for the last reward received from calling the method getNextState( int action ).

Specified by:
getReward in interface RLWorld

validAction

public boolean validAction(int action)
Description copied from interface: RLWorld
Returns true if the given action is a valid action on the current state, false if not.

Specified by:
validAction in interface RLWorld

endState

public boolean endState()
Description copied from interface: RLWorld
Returns true if current state is absorbing state, false if not.

Specified by:
endState in interface RLWorld

setEndState

public void setEndState(boolean end)

resetState

public int[] resetState()
Description copied from interface: RLWorld
Resets the current state to the start position and returns that state.

Specified by:
resetState in interface RLWorld

getInitValues

public double getInitValues()
Description copied from interface: RLWorld
Gets the initial value for the policy.

Specified by:
getInitValues in interface RLWorld