#include <LightWorld.hh>
Classes | |
struct | room_info |
Public Types | |
typedef std::pair< float, float > | coord_t |
enum | lightworld_action_t { NORTH, EAST, WEST, SOUTH, PICKUP, PRESS, NUM_ACTIONS } |
Public Member Functions | |
virtual float | apply (int action) |
int | applyNoise (int action) |
virtual void | getMinMaxFeatures (std::vector< float > *minFeat, std::vector< float > *maxFeat) |
virtual void | getMinMaxReward (float *minR, float *maxR) |
virtual int | getNumActions () |
virtual bool | isEpisodic () |
LightWorld (Random &rand, bool stochastic, int nrooms) | |
void | print_map () const |
void | print_state () const |
virtual void | reset () |
void | resetKey () |
virtual const std::vector < float > & | sensation () const |
void | setKey (std::vector< float > testS) |
virtual bool | terminal () const |
void | updateSensors () |
void | updateVisits () |
virtual | ~LightWorld () |
Public Attributes | |
float & | door_e |
float & | door_n |
float & | door_open |
float & | door_s |
float & | door_w |
int | doorOpen |
int | doorVisited |
float & | ew |
float & | have_key |
int | haveKey |
float & | key_e |
float & | key_n |
float & | key_s |
float & | key_w |
int | keyVisited |
int | leaveRoom |
float & | lock_e |
float & | lock_n |
float & | lock_s |
float & | lock_w |
int | lockVisited |
bool | LWDEBUG |
int | MAX_SENSE |
const bool | noisy |
int | nrooms |
float & | ns |
int | pickupDoor |
int | pickupKeyCorrect |
int | pickupKeyIncorrect |
int | pickupLock |
int | pickupOther |
int | pressDoor |
int | pressKey |
int | pressLockCorrect |
int | pressLockIncorrect |
int | pressOther |
Random & | rng |
float & | room_id |
std::vector< room_info > | rooms |
std::vector< float > | s |
int | totalVisited |
Friends | |
std::ostream & | operator<< (std::ostream &out, const LightWorld &playroom) |
The LightWorld domain from "Building Portable Options: Skill Transfer in Reinforcement Learning" by Konidaris and Barto
Definition at line 15 of file LightWorld.hh.
typedef std::pair<float,float> LightWorld::coord_t |
Definition at line 54 of file LightWorld.hh.
Definition at line 55 of file LightWorld.hh.
LightWorld::LightWorld | ( | Random & | rand, |
bool | stochastic, | ||
int | nrooms | ||
) |
Creates a PlayRoom domain using the specified map. Puts objects in random locations.
rand | Random number generator to use. |
stochastic | Whether to use nondeterministic actions |
nrooms | Number of rooms to have |
The LightWorld domain from "Building Portable Options: Skill Transfer in Reinforcement Learning" by Konidaris and Barto
Definition at line 10 of file LightWorld.cc.
LightWorld::~LightWorld | ( | ) | [virtual] |
Definition at line 61 of file LightWorld.cc.
float LightWorld::apply | ( | int | action | ) | [virtual] |
Implements Environment.
Definition at line 86 of file LightWorld.cc.
int LightWorld::applyNoise | ( | int | action | ) |
Definition at line 70 of file LightWorld.cc.
void LightWorld::getMinMaxFeatures | ( | std::vector< float > * | minFeat, |
std::vector< float > * | maxFeat | ||
) | [virtual] |
Implements Environment.
Definition at line 391 of file LightWorld.cc.
void LightWorld::getMinMaxReward | ( | float * | minR, |
float * | maxR | ||
) | [virtual] |
Implements Environment.
Definition at line 410 of file LightWorld.cc.
int LightWorld::getNumActions | ( | ) | [virtual] |
Implements Environment.
Definition at line 354 of file LightWorld.cc.
virtual bool LightWorld::isEpisodic | ( | ) | [inline, virtual] |
Reimplemented from Environment.
Definition at line 33 of file LightWorld.hh.
void LightWorld::print_map | ( | ) | const |
Prints the current map.
Definition at line 360 of file LightWorld.cc.
void LightWorld::print_state | ( | ) | const |
Prints the current state
void LightWorld::reset | ( | void | ) | [virtual] |
Implements Environment.
Definition at line 288 of file LightWorld.cc.
void LightWorld::resetKey | ( | ) |
Definition at line 256 of file LightWorld.cc.
const std::vector< float > & LightWorld::sensation | ( | ) | const [virtual] |
Implements Environment.
Definition at line 64 of file LightWorld.cc.
void LightWorld::setKey | ( | std::vector< float > | testS | ) |
Definition at line 263 of file LightWorld.cc.
bool LightWorld::terminal | ( | ) | const [virtual] |
Implements Environment.
Definition at line 282 of file LightWorld.cc.
void LightWorld::updateSensors | ( | ) |
Definition at line 195 of file LightWorld.cc.
void LightWorld::updateVisits | ( | ) |
std::ostream& operator<< | ( | std::ostream & | out, |
const LightWorld & | playroom | ||
) | [friend] |
float& LightWorld::door_e |
Definition at line 78 of file LightWorld.hh.
float& LightWorld::door_n |
Definition at line 77 of file LightWorld.hh.
float& LightWorld::door_open |
Definition at line 67 of file LightWorld.hh.
float& LightWorld::door_s |
Definition at line 80 of file LightWorld.hh.
float& LightWorld::door_w |
Definition at line 79 of file LightWorld.hh.
Definition at line 100 of file LightWorld.hh.
Definition at line 98 of file LightWorld.hh.
float& LightWorld::ew |
Definition at line 65 of file LightWorld.hh.
float& LightWorld::have_key |
Definition at line 66 of file LightWorld.hh.
Definition at line 99 of file LightWorld.hh.
float& LightWorld::key_e |
Definition at line 70 of file LightWorld.hh.
float& LightWorld::key_n |
Definition at line 69 of file LightWorld.hh.
float& LightWorld::key_s |
Definition at line 72 of file LightWorld.hh.
float& LightWorld::key_w |
Definition at line 71 of file LightWorld.hh.
Definition at line 96 of file LightWorld.hh.
Definition at line 101 of file LightWorld.hh.
float& LightWorld::lock_e |
Definition at line 74 of file LightWorld.hh.
float& LightWorld::lock_n |
Definition at line 73 of file LightWorld.hh.
float& LightWorld::lock_s |
Definition at line 76 of file LightWorld.hh.
float& LightWorld::lock_w |
Definition at line 75 of file LightWorld.hh.
Definition at line 97 of file LightWorld.hh.
bool LightWorld::LWDEBUG |
Definition at line 57 of file LightWorld.hh.
Definition at line 113 of file LightWorld.hh.
const bool LightWorld::noisy |
Definition at line 59 of file LightWorld.hh.
Definition at line 60 of file LightWorld.hh.
float& LightWorld::ns |
Definition at line 64 of file LightWorld.hh.
Definition at line 110 of file LightWorld.hh.
Definition at line 107 of file LightWorld.hh.
Definition at line 108 of file LightWorld.hh.
Definition at line 109 of file LightWorld.hh.
Definition at line 111 of file LightWorld.hh.
Definition at line 105 of file LightWorld.hh.
Definition at line 102 of file LightWorld.hh.
Definition at line 103 of file LightWorld.hh.
Definition at line 104 of file LightWorld.hh.
Definition at line 106 of file LightWorld.hh.
Definition at line 61 of file LightWorld.hh.
float& LightWorld::room_id |
Definition at line 68 of file LightWorld.hh.
std::vector<room_info> LightWorld::rooms |
Definition at line 82 of file LightWorld.hh.
std::vector<float> LightWorld::s |
Definition at line 63 of file LightWorld.hh.
Definition at line 95 of file LightWorld.hh.