Implementation of Fruit Tree Navigation Task. More...

Classes

class  Action
 Implementation of action for Fruit Tree Navigation task. More...

 
class  State
 Implementation of Fruit Tree Navigation state. More...

 

Public Member Functions

 FruitTreeNavigation (const size_t maxSteps=500, const size_t depth=6)
 Construct a Fruit Tree Navigation instance using the given constants. More...

 
State InitialSample ()
 This function does null initialization of state space. More...

 
bool IsTerminal (const State &state) const
 This function checks if the FTN has reached the terminal state. More...

 
size_t MaxSteps () const
 Get the maximum number of steps allowed. More...

 
size_t & MaxSteps ()
 Set the maximum number of steps allowed. More...

 
arma::vec Sample (const State &state, const Action &action, State &nextState)
 Dynamics of the FTN System. More...

 
arma::vec Sample (const State &state, const Action &action)
 Dynamics of the FTN System. More...

 
size_t StepsPerformed () const
 Get the number of steps performed. More...

 

Static Public Attributes

static constexpr size_t rewardSize = 6
 The reward vector consists of {Protein, Carbs, Fats, Vitamins, Minerals, Water} A total of 6 rewards. More...

 

Detailed Description

Implementation of Fruit Tree Navigation Task.

For more details, see the following:

@incollection{yang2019morl,
title = {A Generalized Algorithm for Multi-Objective Reinforcement Learning and Policy Adaptation},
author = {Yang, Runzhe and Sun, Xingyuan and Narasimhan, Karthik},
booktitle = {Advances in Neural Information Processing Systems 32},
pages = {14610--14621},
year = {2019}
}

Definition at line 35 of file ftn.hpp.

Constructor & Destructor Documentation

◆ FruitTreeNavigation()

FruitTreeNavigation ( const size_t  maxSteps = 500,
const size_t  depth = 6 
)
inline

Construct a Fruit Tree Navigation instance using the given constants.

Parameters
maxStepsThe number of steps after which the episode terminates. If the value is 0, there is no limit.
depthThe maximum depth of the full binary tree.

Definition at line 104 of file ftn.hpp.

Member Function Documentation

◆ InitialSample()

State InitialSample ( )
inline

This function does null initialization of state space.

Init to the root of the tree (0, 0).

Definition at line 168 of file ftn.hpp.

References FruitTreeNavigation::State::State().

◆ IsTerminal()

bool IsTerminal ( const State state) const
inline

This function checks if the FTN has reached the terminal state.

Parameters
stateThe current State.
Returns
true if state is a terminal state, otherwise false.

Definition at line 180 of file ftn.hpp.

References Log::Info, and FruitTreeNavigation::State::Row().

Referenced by FruitTreeNavigation::Sample().

◆ MaxSteps() [1/2]

size_t MaxSteps ( ) const
inline

Get the maximum number of steps allowed.

Definition at line 200 of file ftn.hpp.

◆ MaxSteps() [2/2]

size_t& MaxSteps ( )
inline

Set the maximum number of steps allowed.

Definition at line 202 of file ftn.hpp.

◆ Sample() [1/2]

arma::vec Sample ( const State state,
const Action action,
State nextState 
)
inline

Dynamics of the FTN System.

To get reward and next state based on current state and current action. Return null vector reward as default.

Parameters
stateThe current State.
actionThe action taken.
nextStateThe next state.
Returns
reward, defaults to null vector.

Definition at line 121 of file ftn.hpp.

References FruitTreeNavigation::Action::action, FruitTreeNavigation::State::Column(), FruitTreeNavigation::IsTerminal(), FruitTreeNavigation::rewardSize, and FruitTreeNavigation::State::Row().

Referenced by FruitTreeNavigation::Sample().

◆ Sample() [2/2]

arma::vec Sample ( const State state,
const Action action 
)
inline

Dynamics of the FTN System.

To get reward and next state based on current state and current action. This function calls the Sample function to estimate the next state return reward for taking a particular action.

Parameters
stateThe current State.
actionThe action taken.
Returns
nextState The next state.

Definition at line 158 of file ftn.hpp.

References FruitTreeNavigation::Sample().

◆ StepsPerformed()

size_t StepsPerformed ( ) const
inline

Get the number of steps performed.

Definition at line 197 of file ftn.hpp.

Member Data Documentation

◆ rewardSize

constexpr size_t rewardSize = 6
static

The reward vector consists of {Protein, Carbs, Fats, Vitamins, Minerals, Water} A total of 6 rewards.

Definition at line 206 of file ftn.hpp.

Referenced by FruitTreeNavigation::Sample().


The documentation for this class was generated from the following file:
  • /home/jenkins-mlpack/mlpack.org/_src/mlpack-git/src/mlpack/methods/reinforcement_learning/environment/ftn.hpp