Public Member Functions | Protected Types | Private Member Functions | Private Attributes
TwoRooms Class Reference

#include <tworooms.hh>

Inheritance diagram for TwoRooms:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual float apply (int action)
experience getExp (float s0, float s1, int a)
virtual void getMinMaxFeatures (std::vector< float > *minFeat, std::vector< float > *maxFeat)
virtual void getMinMaxReward (float *minR, float *maxR)
virtual int getNumActions ()
virtual std::vector< experiencegetSeedings ()
virtual void reset ()
virtual const std::vector
< float > & 
sensation () const
virtual bool terminal () const
 TwoRooms (Random &rand, bool stochastic, bool rewardType, int actDelay, bool multiGoal)
virtual ~TwoRooms ()

Protected Types

typedef std::pair< float, float > coord_t
enum  room_action_t { NORTH, SOUTH, EAST, WEST }

Private Member Functions

room_action_t add_noise (room_action_t action)
const Gridworldcreate_default_map ()
void randomize_goal ()
float reward ()

Private Attributes

const int actDelay
std::deque< int > actHistory
coord_t doorway
float & ew
coord_t goal
coord_t goal2
const Gridworld *const grid
const bool multiGoal
const bool negReward
const bool noisy
float & ns
Randomrng
std::vector< float > s
bool useGoal2

Detailed Description

This class defines a two room gridworld domain. It can optionally be stochastic, have action delays, or multiple goals (with partial observability).

Definition at line 20 of file tworooms.hh.


Member Typedef Documentation

typedef std::pair<float,float> TwoRooms::coord_t [protected]

Definition at line 50 of file tworooms.hh.


Member Enumeration Documentation

enum TwoRooms::room_action_t [protected]
Enumerator:
NORTH 
SOUTH 
EAST 
WEST 

Definition at line 51 of file tworooms.hh.


Constructor & Destructor Documentation

TwoRooms::TwoRooms ( Random rand,
bool  stochastic,
bool  rewardType,
int  actDelay,
bool  multiGoal 
)

Standard Constructor

Parameters:
randRandom Number generator
stochasticMake the domain stochastic
rewardTypeCreate -1 per step and 0 on termination (vs 0 and 1)
actDelay# of steps to delay actions
multiGoalcreate mulitple goals that are randomly selected from each episode

Definition at line 10 of file tworooms.cc.

TwoRooms::~TwoRooms ( ) [virtual]

Definition at line 29 of file tworooms.cc.


Member Function Documentation

Corrupts a movement action.

Parameters:
actionThe intended action
Returns:
The action actually executed

Definition at line 186 of file tworooms.cc.

float TwoRooms::apply ( int  action) [virtual]

Implements Environment.

Definition at line 37 of file tworooms.cc.

const Gridworld * TwoRooms::create_default_map ( ) [private]

Create default two room gridworld

Definition at line 162 of file tworooms.cc.

experience TwoRooms::getExp ( float  s0,
float  s1,
int  a 
)

Create an experience tuple for the given state-action.

Definition at line 263 of file tworooms.cc.

void TwoRooms::getMinMaxFeatures ( std::vector< float > *  minFeat,
std::vector< float > *  maxFeat 
) [virtual]

Implements Environment.

Definition at line 207 of file tworooms.cc.

void TwoRooms::getMinMaxReward ( float *  minR,
float *  maxR 
) [virtual]

Implements Environment.

Definition at line 217 of file tworooms.cc.

int TwoRooms::getNumActions ( ) [virtual]

Implements Environment.

Definition at line 157 of file tworooms.cc.

std::vector< experience > TwoRooms::getSeedings ( ) [virtual]

Reimplemented from Environment.

Definition at line 229 of file tworooms.cc.

void TwoRooms::randomize_goal ( ) [private]

Randomly assigns the goal to any random position in the world.

Definition at line 200 of file tworooms.cc.

void TwoRooms::reset ( void  ) [virtual]

Implements Environment.

Definition at line 134 of file tworooms.cc.

float TwoRooms::reward ( ) [private]

Return the correct reward based on the current state.

Definition at line 97 of file tworooms.cc.

const std::vector< float > & TwoRooms::sensation ( ) const [virtual]

Implements Environment.

Definition at line 31 of file tworooms.cc.

bool TwoRooms::terminal ( ) const [virtual]

Implements Environment.

Definition at line 125 of file tworooms.cc.


Member Data Documentation

const int TwoRooms::actDelay [private]

Definition at line 62 of file tworooms.hh.

std::deque<int> TwoRooms::actHistory [private]

Definition at line 57 of file tworooms.hh.

Definition at line 67 of file tworooms.hh.

float& TwoRooms::ew [private]

Definition at line 72 of file tworooms.hh.

Definition at line 55 of file tworooms.hh.

Definition at line 56 of file tworooms.hh.

const Gridworld* const TwoRooms::grid [private]

Definition at line 54 of file tworooms.hh.

const bool TwoRooms::multiGoal [private]

Definition at line 63 of file tworooms.hh.

const bool TwoRooms::negReward [private]

Definition at line 60 of file tworooms.hh.

const bool TwoRooms::noisy [private]

Definition at line 61 of file tworooms.hh.

float& TwoRooms::ns [private]

Definition at line 71 of file tworooms.hh.

Random& TwoRooms::rng [private]

Definition at line 65 of file tworooms.hh.

std::vector<float> TwoRooms::s [private]

Definition at line 69 of file tworooms.hh.

bool TwoRooms::useGoal2 [private]

Definition at line 58 of file tworooms.hh.


The documentation for this class was generated from the following files:


rl_env
Author(s):
autogenerated on Thu Jun 6 2019 22:00:24