Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

BanditMachine Class Reference

#include <BanditMachine.h>

Inheritance diagram for BanditMachine:

Inheritance graph
[legend]
List of all members.

Detailed Description

Plays K-armed bandit.

Definition at line 20 of file BanditMachine.h.

Public Member Functions

 BanditMachine ()
 constructor
 BanditMachine (const char *n)
 constructor
virtual ~BanditMachine ()
 destructor
virtual std::string getDescription () const
 Gives a short description of what this particular instantiation does (in case a more specific description is needed on an individual basis).
virtual void setup ()
 This is called by DoStart() when you should setup the network of subnodes (if any).
virtual void DoStart ()
 Transitions should call this when you are entering the state, so it can enable its transitions.
virtual void DoStop ()
 Transitions should call this when you are leaving the state, so it can disable its transitions.

Static Public Member Functions

static std::string getClassDescription ()
 Gives a short description of what this class of behaviors does... you should override this (but don't have to).

Protected Attributes

StareAtBallBehaviorstare
 active as long as we're in this state so it keeps an eye on the ball
StateNodestart
 used to start off by lying down before we start pressing buttons
MotionManager::MC_ID liedown
 a MotionSequence which will move the dog into a lying down posture
karmedbanditExp3_1 bandit
 algorithm to use in the k-armed bandit problem

Private Member Functions

 BanditMachine (const BanditMachine &node)
 don't call this
BanditMachine operator= (const BanditMachine &node)
 don't call this

Classes

class  DecideNode
 uses one of the algorithms in karmedbandit.h to decide which paw to press next More...
class  PressNode
 This node is used to move a paw down using a MotionSequenceMC. More...
class  WaitNode
 Waits to see if a reward is received, lights up LEDs to let the user know. More...


Constructor & Destructor Documentation

BanditMachine::BanditMachine  )  [inline]
 

constructor

Definition at line 23 of file BanditMachine.h.

BanditMachine::BanditMachine const char *  n  )  [inline]
 

constructor

Definition at line 30 of file BanditMachine.h.

virtual BanditMachine::~BanditMachine  )  [inline, virtual]
 

destructor

Definition at line 37 of file BanditMachine.h.

BanditMachine::BanditMachine const BanditMachine node  )  [private]
 

don't call this


Member Function Documentation

virtual void BanditMachine::DoStart  )  [inline, virtual]
 

Transitions should call this when you are entering the state, so it can enable its transitions.

Reimplemented from StateNode.

Definition at line 60 of file BanditMachine.h.

virtual void BanditMachine::DoStop  )  [inline, virtual]
 

Transitions should call this when you are leaving the state, so it can disable its transitions.

Reimplemented from StateNode.

Definition at line 72 of file BanditMachine.h.

static std::string BanditMachine::getClassDescription  )  [inline, static]
 

Gives a short description of what this class of behaviors does... you should override this (but don't have to).

If you do override this, also consider overriding getDescription() to return it

Reimplemented from BehaviorBase.

Definition at line 41 of file BanditMachine.h.

Referenced by getDescription().

virtual std::string BanditMachine::getDescription  )  const [inline, virtual]
 

Gives a short description of what this particular instantiation does (in case a more specific description is needed on an individual basis).

By default simply returns getName(), because any calls from a BehaviorBase function to getClassDescription() are going to call BehaviorBase::getClassDescription(), not ~YourSubClass~getClassDescription(), because static functions can't be virtual in C++ (doh!)

This means that getDescription called on a pointer to a BehaviorBase of unknown subtype would always return an empty string, which is pretty useless. So instead we return the name in this situation. If you want getDescription to return getClassDescription, you'll have to override it in your subclass to do so.

Reimplemented from BehaviorBase.

Definition at line 42 of file BanditMachine.h.

BanditMachine BanditMachine::operator= const BanditMachine node  )  [private]
 

don't call this

virtual void BanditMachine::setup  )  [inline, virtual]
 

This is called by DoStart() when you should setup the network of subnodes (if any).

Reimplemented from StateNode.

Definition at line 44 of file BanditMachine.h.


Member Data Documentation

karmedbanditExp3_1 BanditMachine::bandit [protected]
 

algorithm to use in the k-armed bandit problem

Definition at line 205 of file BanditMachine.h.

Referenced by setup().

MotionManager::MC_ID BanditMachine::liedown [protected]
 

a MotionSequence which will move the dog into a lying down posture

Definition at line 204 of file BanditMachine.h.

Referenced by DoStart(), and DoStop().

StareAtBallBehavior* BanditMachine::stare [protected]
 

active as long as we're in this state so it keeps an eye on the ball

Definition at line 202 of file BanditMachine.h.

Referenced by BanditMachine(), DoStart(), DoStop(), and ~BanditMachine().

StateNode* BanditMachine::start [protected]
 

used to start off by lying down before we start pressing buttons

Definition at line 203 of file BanditMachine.h.

Referenced by DoStart(), and setup().


The documentation for this class was generated from the following file:

Tekkotsu v2.4.1
Generated Tue Aug 16 16:34:57 2005 by Doxygen 1.4.4