#include <fourrooms.hh>
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 Gridworld & | gridworld () 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 Gridworld * | create_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 |
Random & | rng |
std::vector< float > | s |
std::vector< float > | unused |
Friends | |
std::ostream & | operator<< (std::ostream &out, const FourRooms &rooms) |
Definition at line 21 of file fourrooms.hh.
typedef std::pair<float,float> FourRooms::coord_t [protected] |
Definition at line 70 of file fourrooms.hh.
enum FourRooms::room_action_t [protected] |
Definition at line 71 of file fourrooms.hh.
FourRooms::FourRooms | ( | Random & | rand, |
const Gridworld * | gridworld, | ||
bool | stochastic | ||
) |
FourRooms::FourRooms | ( | Random & | rand | ) |
Creates a deterministic FourRooms domain.
rand | Random number generator used solely for random initial states. |
negReward | Whether 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.
FourRooms::room_action_t FourRooms::add_noise | ( | room_action_t | action | ) | [private] |
Corrupts a movement action.
action | The intended action |
Definition at line 494 of file fourrooms.cc.
float FourRooms::apply | ( | int | action | ) | [virtual] |
Implements Environment.
Definition at line 145 of file fourrooms.cc.
void FourRooms::calcWallDistances | ( | ) |
Definition at line 262 of file fourrooms.cc.
const Gridworld * FourRooms::create_default_map | ( | ) | [private] |
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.
std::ostream& operator<< | ( | std::ostream & | out, |
const FourRooms & | rooms | ||
) | [friend] |
Definition at line 433 of file fourrooms.cc.
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.
coord_t FourRooms::doorway [private] |
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.
coord_t FourRooms::goal [private] |
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.