#include <energyrooms.hh>
Public Member Functions | |
virtual float | apply (int action) |
EnergyRooms (Random &rand, const Gridworld *gridworld, bool stochastic) | |
EnergyRooms (Random &rand, bool negReward) | |
EnergyRooms (Random &rand, bool stochastic, bool negReward, bool goalOption) | |
EnergyRooms (Random &rand, bool stochastic, bool negReward, bool goalOption, bool fuel) | |
EnergyRooms (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 |
virtual bool | terminal () const |
virtual | ~EnergyRooms () |
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 () |
Private Attributes | |
coord_t | doorway |
float & | energy |
float & | ew |
const bool | fuel |
coord_t | goal |
const bool | goalOption |
const Gridworld *const | grid |
const bool | negReward |
const bool | noisy |
float & | ns |
Random & | rng |
std::vector< float > | s |
Friends | |
std::ostream & | operator<< (std::ostream &out, const EnergyRooms &rooms) |
Definition at line 21 of file energyrooms.hh.
typedef std::pair<float,float> EnergyRooms::coord_t [protected] |
Definition at line 64 of file energyrooms.hh.
enum EnergyRooms::room_action_t [protected] |
Definition at line 65 of file energyrooms.hh.
EnergyRooms::EnergyRooms | ( | Random & | rand, |
const Gridworld * | gridworld, | ||
bool | stochastic | ||
) |
Creates a EnergyRooms domain using the specified map.
rand | Random number generator to use. |
gridworld | The map to use. |
stochastic | Whether to use nondeterministic actions. |
EnergyRooms::EnergyRooms | ( | Random & | rand, |
bool | negReward | ||
) |
Creates a deterministic EnergyRooms domain.
rand | Random number generator used solely for random initial states. |
negReward | Whether negative rewards are on/off. |
Definition at line 15 of file energyrooms.cc.
EnergyRooms::EnergyRooms | ( | Random & | rand, |
bool | stochastic, | ||
bool | negReward, | ||
bool | goalOption | ||
) |
Creates a possibly noisy EnergyRooms domain.
Definition at line 33 of file energyrooms.cc.
EnergyRooms::EnergyRooms | ( | Random & | rand, |
bool | stochastic, | ||
bool | negReward, | ||
bool | goalOption, | ||
bool | fuel | ||
) |
Creates a possibly noisy EnergyRooms domain.
Definition at line 51 of file energyrooms.cc.
EnergyRooms::EnergyRooms | ( | Random & | rand, |
unsigned | width, | ||
unsigned | height, | ||
bool | stochastic | ||
) |
Creates a random EnergyRooms domain of the given size.
EnergyRooms::~EnergyRooms | ( | ) | [virtual] |
Definition at line 85 of file energyrooms.cc.
EnergyRooms::room_action_t EnergyRooms::add_noise | ( | room_action_t | action | ) | [private] |
Corrupts a movement action.
action | The intended action |
Definition at line 346 of file energyrooms.cc.
float EnergyRooms::apply | ( | int | action | ) | [virtual] |
Implements Environment.
Definition at line 93 of file energyrooms.cc.
const Gridworld * EnergyRooms::create_default_map | ( | ) | [private] |
Definition at line 299 of file energyrooms.cc.
void EnergyRooms::getMinMaxFeatures | ( | std::vector< float > * | minFeat, |
std::vector< float > * | maxFeat | ||
) | [virtual] |
Implements Environment.
Definition at line 367 of file energyrooms.cc.
void EnergyRooms::getMinMaxReward | ( | float * | minR, |
float * | maxR | ||
) | [virtual] |
Implements Environment.
Definition at line 377 of file energyrooms.cc.
int EnergyRooms::getNumActions | ( | ) | [virtual] |
Implements Environment.
Definition at line 280 of file energyrooms.cc.
std::vector< std::vector< float > > EnergyRooms::getSubgoals | ( | ) |
Definition at line 238 of file energyrooms.cc.
const Gridworld& EnergyRooms::gridworld | ( | ) | const [inline] |
Definition at line 57 of file energyrooms.hh.
void EnergyRooms::randomize_goal | ( | ) | [private] |
Randomly assigns the goal to any random position in the world.
Definition at line 360 of file energyrooms.cc.
void EnergyRooms::reset | ( | void | ) | [virtual] |
Implements Environment.
Definition at line 219 of file energyrooms.cc.
float EnergyRooms::reward | ( | ) | [private] |
Return the correct reward based on the current state.
Definition at line 170 of file energyrooms.cc.
const std::vector< float > & EnergyRooms::sensation | ( | ) | const [virtual] |
Implements Environment.
Definition at line 87 of file energyrooms.cc.
bool EnergyRooms::terminal | ( | ) | const [virtual] |
Implements Environment.
Definition at line 213 of file energyrooms.cc.
std::ostream& operator<< | ( | std::ostream & | out, |
const EnergyRooms & | rooms | ||
) | [friend] |
Definition at line 285 of file energyrooms.cc.
coord_t EnergyRooms::doorway [private] |
Definition at line 76 of file energyrooms.hh.
float& EnergyRooms::energy [private] |
Definition at line 82 of file energyrooms.hh.
float& EnergyRooms::ew [private] |
Definition at line 81 of file energyrooms.hh.
const bool EnergyRooms::fuel [private] |
Definition at line 85 of file energyrooms.hh.
coord_t EnergyRooms::goal [private] |
Definition at line 69 of file energyrooms.hh.
const bool EnergyRooms::goalOption [private] |
Definition at line 84 of file energyrooms.hh.
const Gridworld* const EnergyRooms::grid [private] |
Definition at line 68 of file energyrooms.hh.
const bool EnergyRooms::negReward [private] |
Definition at line 71 of file energyrooms.hh.
const bool EnergyRooms::noisy [private] |
Definition at line 73 of file energyrooms.hh.
float& EnergyRooms::ns [private] |
Definition at line 80 of file energyrooms.hh.
Random& EnergyRooms::rng [private] |
Definition at line 74 of file energyrooms.hh.
std::vector<float> EnergyRooms::s [private] |
Definition at line 78 of file energyrooms.hh.