Classes | Public Member Functions | Protected Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes
Taxi Class Reference

#include <taxi.hh>

Inheritance diagram for Taxi:
Inheritance graph
[legend]

List of all members.

Classes

class  DefaultLandmarks

Public Member Functions

virtual float apply (int action)
experience getExp (float s0, float s1, float s2, float s3, 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
void setSensation (std::vector< float > newS)
 Taxi (Random &rand, const Gridworld *gridworld, bool stochastic)
 Taxi (Random &rand)
 Taxi (Random &rand, bool stochastic)
 Taxi (Random &rand, unsigned width, unsigned height, bool stochastic)
virtual bool terminal () const
virtual ~Taxi ()

Protected Types

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

Private Member Functions

taxi_action_t add_noise (taxi_action_t action)
void apply_fickle_passenger ()
void randomize_landmarks ()
void randomize_landmarks_to_corners ()

Static Private Member Functions

static const Gridworldcreate_default_map ()

Private Attributes

float & dest
float & ew
bool fickle
const Gridworld *const grid
std::vector< coord_tlandmarks
const bool noisy
float & ns
float & pass
Randomrng
std::vector< float > s

Static Private Attributes

static const DefaultLandmarks defaultlandmarks

Detailed Description

This class defines the Taxi domain.

Definition at line 17 of file taxi.hh.


Member Typedef Documentation

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

Definition at line 66 of file taxi.hh.


Member Enumeration Documentation

enum Taxi::taxi_action_t [protected]
Enumerator:
NORTH 
SOUTH 
EAST 
WEST 
PICKUP 
PUTDOWN 

Definition at line 67 of file taxi.hh.


Constructor & Destructor Documentation

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

Creates a Taxi domain using the specified map.

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

Definition at line 19 of file taxi.cc.

Taxi::Taxi ( Random rand)

Creates a deterministic Taxi domain.

Parameters:
randRandom number generator used solely for random initial states.

Definition at line 31 of file taxi.cc.

Taxi::Taxi ( Random rand,
bool  stochastic 
)

Creates a possibly noisy Taxi domain.

Parameters:
randRandom number generator to use.
stochasticWhether to use nondeterministic actions and fickle passenger.

Definition at line 45 of file taxi.cc.

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

Creates a random Taxi domain of the given size.

Parameters:
randRandom number generator to use.
widthwidth of grid
heightheight of grid
stochasticWhether to use nondeterministic actions and fickle passenger.

Definition at line 59 of file taxi.cc.

Taxi::~Taxi ( ) [virtual]

Definition at line 72 of file taxi.cc.


Member Function Documentation

Corrupts a movement action.

Parameters:
actionThe intended action
Returns:
The action actually executed

Definition at line 172 of file taxi.cc.

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

Implements Environment.

Definition at line 76 of file taxi.cc.

void Taxi::apply_fickle_passenger ( ) [private]

If the domain is noisy and the taxi has just taken its first step since picking up the passenger, then potentially change the destination.

Definition at line 185 of file taxi.cc.

const Gridworld * Taxi::create_default_map ( ) [static, private]

Create the default gridworld

Definition at line 160 of file taxi.cc.

experience Taxi::getExp ( float  s0,
float  s1,
float  s2,
float  s3,
int  a 
)

Get an example experience for the given state-action.

Definition at line 263 of file taxi.cc.

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

Implements Environment.

Definition at line 286 of file taxi.cc.

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

Implements Environment.

Definition at line 303 of file taxi.cc.

int Taxi::getNumActions ( ) [virtual]

Implements Environment.

Definition at line 155 of file taxi.cc.

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

Reimplemented from Environment.

Definition at line 240 of file taxi.cc.

void Taxi::randomize_landmarks ( ) [private]

Randomly assigns the four landmarks to any four distinct positions in the world.

Definition at line 197 of file taxi.cc.

Randomly assigns the landmarks to positions near the corners of the map.

Definition at line 217 of file taxi.cc.

void Taxi::reset ( void  ) [virtual]

Implements Environment.

Definition at line 144 of file taxi.cc.

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

Implements Environment.

Definition at line 74 of file taxi.cc.

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

Set the current state (for debug purposes)

Reimplemented from Environment.

Definition at line 230 of file taxi.cc.

bool Taxi::terminal ( ) const [virtual]

Implements Environment.

Definition at line 140 of file taxi.cc.


Member Data Documentation

Definition at line 92 of file taxi.hh.

float& Taxi::dest [private]

Definition at line 87 of file taxi.hh.

float& Taxi::ew [private]

Definition at line 85 of file taxi.hh.

bool Taxi::fickle [private]

Definition at line 82 of file taxi.hh.

const Gridworld* const Taxi::grid [private]

Definition at line 76 of file taxi.hh.

std::vector<coord_t> Taxi::landmarks [private]

Definition at line 77 of file taxi.hh.

const bool Taxi::noisy [private]

Definition at line 78 of file taxi.hh.

float& Taxi::ns [private]

Definition at line 84 of file taxi.hh.

float& Taxi::pass [private]

Definition at line 86 of file taxi.hh.

Random& Taxi::rng [private]

Definition at line 79 of file taxi.hh.

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

Definition at line 81 of file taxi.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