AIToolbox
A library that offers tools for AI problem solving.
AIToolbox::Factored::Bandit::Model< Dist > Class Template Reference

This class represents a factored multi-armed bandit. More...

#include <AIToolbox/Factored/Bandit/Model.hpp>

Public Member Functions

template<typename... TupleArgs>
 Model (Action A, std::vector< PartialKeys > deps, std::vector< AIToolbox::Bandit::Model< Dist >> arms)
 Basic constructor. More...
 
const RewardssampleR (const Action &a) const
 This function samples the specified joint bandit arm. More...
 
const ActiongetA () const
 This function returns the joint action space. More...
 
const std::vector< PartialKeys > & getGroups () const
 This function returns a reference to the agent groupings. More...
 
const std::vector< AIToolbox::Bandit::Model< Dist > > & getArms () const
 This function returns a reference to the internal local arms. More...
 

Detailed Description

template<typename Dist>
class AIToolbox::Factored::Bandit::Model< Dist >

This class represents a factored multi-armed bandit.

A factored multi-armed bandit is a specific bandit class, where the reward function is factored into independent components, each of which only depends on a subset of agents. The goal is generally to maximize the sum of the rewards of all local arms.

It effectively behaves as a collection of multi-armed bandits, aside from the fact that the action each agent takes will be the same in all bandits that it participates into. Each "local" bandit's effective action will be the combination of all participating agents.

This structure can make learning learning how to act much more efficient, as exploiting the factorization allows to extract more information from each joint action performed by the agents.

Template Parameters
DistThe distribution to use for all local arms.

Constructor & Destructor Documentation

◆ Model()

template<typename Dist >
template<typename... TupleArgs>
AIToolbox::Factored::Bandit::Model< Dist >::Model ( Action  A,
std::vector< PartialKeys deps,
std::vector< AIToolbox::Bandit::Model< Dist >>  arms 
)

Basic constructor.

This constructor creates the factored multi-armed bandit from a set of standard bandits, each associated with a group of agents.

Note that the action space of each bandit must be equal to the product of the action spaces of all agents in its group. For example, a bandit associated with agents with action spaces 2, 3, 2 should have 12 arms in total.

Parameters
AThe joint action space.
depsThe agents associated with each bandit.
armsThe local bandits to use.

Member Function Documentation

◆ getA()

template<typename Dist >
const Action & AIToolbox::Factored::Bandit::Model< Dist >::getA

This function returns the joint action space.

◆ getArms()

template<typename Dist >
const std::vector< AIToolbox::Bandit::Model< Dist > > & AIToolbox::Factored::Bandit::Model< Dist >::getArms

This function returns a reference to the internal local arms.

◆ getGroups()

template<typename Dist >
const std::vector< PartialKeys > & AIToolbox::Factored::Bandit::Model< Dist >::getGroups

This function returns a reference to the agent groupings.

◆ sampleR()

template<typename Dist >
const Rewards & AIToolbox::Factored::Bandit::Model< Dist >::sampleR ( const Action a) const

This function samples the specified joint bandit arm.

Parameters
aThe joint arm to sample.
Returns
A vector containing the rewards of each local arm.

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