Public Member Functions | Protected Types | Private Member Functions | Private Attributes | Friends
FourRooms Class Reference

#include <fourrooms.hh>

Inheritance diagram for FourRooms:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual float apply (int action)
void calcWallDistances ()
 FourRooms (Random &rand, const Gridworld *gridworld, bool stochastic)
 FourRooms (Random &rand)
 FourRooms (Random &rand, bool stochastic, bool negReward, bool exReward)
 FourRooms (Random &rand, bool stochastic, bool negReward)
 FourRooms (Random &rand, bool stochastic)
 FourRooms (Random &rand, unsigned width, unsigned height, bool stochastic)
virtual void getMinMaxFeatures (std::vector< float > *minFeat, std::vector< float > *maxFeat)
virtual void getMinMaxReward (float *minR, float *maxR)
virtual int getNumActions ()
std::vector< std::vector< float > > getSubgoals ()
const Gridworldgridworld () const
virtual void reset ()
virtual const std::vector
< float > & 
sensation () const
void setSensation (std::vector< float > newS)
virtual bool terminal () const
virtual ~FourRooms ()

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 (int effect)

Private Attributes

float & distE
float & distN
float & distS
float & distW
coord_t doorway
float & ew
const bool extraReward
coord_t goal
const bool goalOption
const Gridworld *const grid
const bool negReward
const bool noisy
float & ns
float & rewardEW
float & rewardNS
const bool rewardSensor
Randomrng
std::vector< float > s
std::vector< float > unused

Friends

std::ostream & operator<< (std::ostream &out, const FourRooms &rooms)

Detailed Description

Definition at line 21 of file fourrooms.hh.


Member Typedef Documentation

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

Definition at line 70 of file fourrooms.hh.


Member Enumeration Documentation

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

Definition at line 71 of file fourrooms.hh.


Constructor & Destructor Documentation

FourRooms::FourRooms ( Random rand,
const Gridworld gridworld,
bool  stochastic 
)

Creates a FourRooms domain using the specified map.

Parameters:
randRandom number generator to use.
gridworldThe map to use.
stochasticWhether to use nondeterministic actions.

Creates a deterministic FourRooms domain.

Parameters:
randRandom number generator used solely for random initial states.
negRewardWhether negative rewards are on/off.

Definition at line 16 of file fourrooms.cc.

FourRooms::FourRooms ( Random rand,
bool  stochastic,
bool  negReward,
bool  exReward 
)

Creates a possibly noisy FourRooms domain.

Definition at line 42 of file fourrooms.cc.

FourRooms::FourRooms ( Random rand,
bool  stochastic,
bool  negReward 
)

Creates a possibly noisy FourRooms domain with distances to walls.

Definition at line 68 of file fourrooms.cc.

FourRooms::FourRooms ( Random rand,
bool  stochastic 
)

Creates a Four Rooms domain with distance and reward distances

Definition at line 95 of file fourrooms.cc.

FourRooms::FourRooms ( Random rand,
unsigned  width,
unsigned  height,
bool  stochastic 
)

Creates a random FourRooms domain of the given size.

FourRooms::~FourRooms ( ) [virtual]

Definition at line 137 of file fourrooms.cc.


Member Function Documentation

Corrupts a movement action.

Parameters:
actionThe intended action
Returns:
The action actually executed

Definition at line 494 of file fourrooms.cc.

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

Implements Environment.

Definition at line 145 of file fourrooms.cc.

Definition at line 262 of file fourrooms.cc.

Definition at line 447 of file fourrooms.cc.

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

Implements Environment.

Definition at line 527 of file fourrooms.cc.

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

Implements Environment.

Definition at line 541 of file fourrooms.cc.

int FourRooms::getNumActions ( ) [virtual]

Implements Environment.

Definition at line 428 of file fourrooms.cc.

std::vector< std::vector< float > > FourRooms::getSubgoals ( )

Definition at line 386 of file fourrooms.cc.

const Gridworld& FourRooms::gridworld ( ) const [inline]

Definition at line 60 of file fourrooms.hh.

void FourRooms::randomize_goal ( ) [private]

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

Definition at line 508 of file fourrooms.cc.

void FourRooms::reset ( void  ) [virtual]

Implements Environment.

Definition at line 371 of file fourrooms.cc.

float FourRooms::reward ( int  effect) [private]

Return the correct reward based on the current state.

Definition at line 196 of file fourrooms.cc.

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

Implements Environment.

Definition at line 139 of file fourrooms.cc.

void FourRooms::setSensation ( std::vector< float >  newS) [virtual]

For special use to test true transitions

Reimplemented from Environment.

Definition at line 516 of file fourrooms.cc.

bool FourRooms::terminal ( ) const [virtual]

Implements Environment.

Definition at line 256 of file fourrooms.cc.


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const FourRooms rooms 
) [friend]

Definition at line 433 of file fourrooms.cc.


Member Data Documentation

float& FourRooms::distE [private]

Definition at line 94 of file fourrooms.hh.

float& FourRooms::distN [private]

Definition at line 92 of file fourrooms.hh.

float& FourRooms::distS [private]

Definition at line 93 of file fourrooms.hh.

float& FourRooms::distW [private]

Definition at line 95 of file fourrooms.hh.

Definition at line 84 of file fourrooms.hh.

float& FourRooms::ew [private]

Definition at line 90 of file fourrooms.hh.

const bool FourRooms::extraReward [private]

Definition at line 79 of file fourrooms.hh.

Definition at line 75 of file fourrooms.hh.

const bool FourRooms::goalOption [private]

Definition at line 100 of file fourrooms.hh.

const Gridworld* const FourRooms::grid [private]

Definition at line 74 of file fourrooms.hh.

const bool FourRooms::negReward [private]

Definition at line 77 of file fourrooms.hh.

const bool FourRooms::noisy [private]

Definition at line 78 of file fourrooms.hh.

float& FourRooms::ns [private]

Definition at line 89 of file fourrooms.hh.

float& FourRooms::rewardEW [private]

Definition at line 97 of file fourrooms.hh.

float& FourRooms::rewardNS [private]

Definition at line 98 of file fourrooms.hh.

const bool FourRooms::rewardSensor [private]

Definition at line 80 of file fourrooms.hh.

Random& FourRooms::rng [private]

Definition at line 82 of file fourrooms.hh.

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

Definition at line 86 of file fourrooms.hh.

std::vector<float> FourRooms::unused [private]

Definition at line 87 of file fourrooms.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