MultiAgentDecisionProcess
DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit Class Reference

ParserDPOMDPFormat_Spirit is a parser for DecPOMDPDiscrete. More...

#include <ParserDPOMDPFormat_Spirit.h>

Inheritance diagram for DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit:
[legend]

Classes

struct  AddAction
 
struct  AddAgents
 
struct  AddModels
 
struct  AddObservation
 
struct  AddStartState
 
struct  AddState
 
struct  DebugOutput
 
struct  DebugOutputNoParsed
 
struct  DecPOMDPFileParser
 
struct  dp_SetDiscountParam
 
struct  Initialize
 
struct  InitializeActions
 
struct  InitializeDPOMDP
 
struct  InitializeObservations
 
struct  InitializeStates
 
struct  NextFloatOfRow
 
struct  NextRowOfMatrix
 
struct  NextStringOfIdentList
 
struct  NYI
 
struct  ProcessOMatrix
 
struct  ProcessOProb
 
struct  ProcessORow
 
struct  ProcessR
 
struct  ProcessRMatrix
 
struct  ProcessRRow
 
struct  ProcessStartStateList
 
struct  ProcessTMatrix
 
struct  ProcessTProb
 
struct  ProcessTRow
 
struct  ResetCurIdentList
 
struct  ResetCurMatrix
 
struct  SetAgentIndex
 
struct  SetLastParsedType
 
struct  SetNextAgentIndex
 
struct  SetNrActions
 
struct  SetNrAgents
 
struct  SetNrObservations
 
struct  SetNrStates
 
struct  StartStateExludes
 
struct  StartStateRowProbs
 
struct  StoreLastParsedElement
 
struct  StoreLPAction
 
struct  StoreLPFromState
 
struct  StoreLPJointAction
 
struct  StoreLPJointObservation
 
struct  StoreLPObservation
 
struct  StoreLPToState
 
struct  vt_COSTTOK
 
struct  vt_REWARDTOK
 
struct  WildCardJointAction
 called before StoreLPJointAction in case of a wildcard '*' joint action. More...
 
struct  WildCardJointObservation
 called before StoreLPJointObservation in case of a wildcard '*' joint action. More...
 

Public Member Functions

void ClearCurIdentList ()
 
void ClearCurMatrix ()
 
bool IsDimensionOfMatrix (size_t rows, size_t cols)
 
bool IsRowMatrixLP ()
 
void Parse ()
 The function that starts the parsing. More...
 
 ParserDPOMDPFormat_Spirit (DecPOMDPDiscrete *problem=0)
 (default) Constructor More...
 
- Public Member Functions inherited from ParserInterface
 ParserInterface ()
 (default) Constructor More...
 
virtual ~ParserInterface ()
 

Public Attributes

Index _m_anyJAIndex
 
Index _m_anyJOIndex
 
Index _m_anyStateIndex
 
Index _m_curAI
 
std::vector< std::string > _m_curIdentList
 
std::vector< std::vector
< double > > 
_m_curMatrix
 
iterator_t_m_first
 Pointer to the first iterator. More...
 
bool _m_identListModified
 
double _m_lp_double
 
std::vector< Index_m_lp_fromSI
 A vector that stores the last parsed from-state index. More...
 
int _m_lp_int
 
std::vector< Index_m_lp_JA
 A vector in which the currently parsed individual action indices of a joint action are stored. More...
 
std::vector< Index_m_lp_JAI
 A vector that stores the indices of joint actions that match the last parsed joint action. More...
 
std::vector< Index_m_lp_JO
 similar for the observations... More...
 
std::vector< Index_m_lp_JOI
 similar for the joint observations... More...
 
bool _m_lp_number_negated
 Whether the last optional sign was a '-'. More...
 
bool _m_lp_number_used_opt_sign
 Whether the last 'number' used an optional sign ('+' or '-') More...
 
std::string _m_lp_string
 
std::vector< Index_m_lp_toSI
 idem, but for to-state. More...
 
parsed_t _m_lp_type
 The type (INT or DOUBLE) of the last parsed number. More...
 
unsigned int _m_lp_uint
 The last parsed ... More...
 
bool _m_matrixModified
 
size_t _m_nrA
 
bool _m_startStateListExclude
 A boolean indicating whether the states in the start state list should be excluded (versus the default: uniform prob. More...
 
std::vector< Index_m_startStateListSI
 A vector used to store the state indices for the start state specification. More...
 

Private Types

typedef char char_t
 
typedef position_iterator
< iterator_t_fi
iterator_t
 
typedef file_iterator< char_titerator_t_fi
 
enum  parsed_t {
  INT, DOUBLE, UINT, STRING,
  ASTERICK, UNIFORM, IDENTITY
}
 
typedef rule< scanner_trule_t
 
typedef scanner< iterator_tscanner_t
 

Private Member Functions

DecPOMDPDiscreteGetDecPOMDPDiscrete ()
 

Static Private Member Functions

static void dp_number (iterator_t str, iterator_t end)
 
static void vp_value_tail (iterator_t str, iterator_t end)
 

Private Attributes

DecPOMDPDiscrete_m_decPOMDPDiscrete
 

Detailed Description

ParserDPOMDPFormat_Spirit is a parser for DecPOMDPDiscrete.

That is, it parses the .dpomdp file format.

Member Typedef Documentation

Member Enumeration Documentation

Enumerator
INT 
DOUBLE 
UINT 
STRING 
ASTERICK 
UNIFORM 
IDENTITY 

Constructor & Destructor Documentation

DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::ParserDPOMDPFormat_Spirit ( DecPOMDPDiscrete problem = 0)

Member Function Documentation

void DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::ClearCurIdentList ( )
inline
void DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::ClearCurMatrix ( )
inline
static void DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::dp_number ( iterator_t  str,
iterator_t  end 
)
staticprivate
DecPOMDPDiscrete* DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::GetDecPOMDPDiscrete ( )
inlineprivate

Referenced by DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::DecPOMDPFileParser::DecPOMDPFileParser(), DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::SetNrStates::operator()(), DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::StartStateRowProbs::operator()(), DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::AddStartState::operator()(), DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::SetNrActions::operator()(), DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::AddAction::operator()(), DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::SetNrObservations::operator()(), DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::AddObservation::operator()(), DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::InitializeStates::operator()(), DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::InitializeActions::operator()(), DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::InitializeObservations::operator()(), DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::AddModels::operator()(), DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::StoreLPAction::operator()(), DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::StoreLPObservation::operator()(), DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::InitializeDPOMDP::operator()(), DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::AddAgents::operator()(), DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::dp_SetDiscountParam::operator()(), DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::vt_REWARDTOK::operator()(), DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::vt_COSTTOK::operator()(), DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::AddState::operator()(), Parse(), and DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::ProcessStartStateList::ProcessList().

bool DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::IsDimensionOfMatrix ( size_t  rows,
size_t  cols 
)
inline
bool DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::IsRowMatrixLP ( )
inline
void DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::Parse ( )
virtual
static void DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::vp_value_tail ( iterator_t  str,
iterator_t  end 
)
staticprivate

Member Data Documentation

Index DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::_m_anyStateIndex
std::vector<std::string> DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::_m_curIdentList
DecPOMDPDiscrete* DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::_m_decPOMDPDiscrete
private
iterator_t* DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::_m_first

Pointer to the first iterator.

This is used to give informative error messages. (Specifically the position of the error.

Referenced by DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::Initialize::operator()(), and DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::AddStartState::operator()().

std::vector<Index> DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::_m_lp_fromSI

A vector that stores the last parsed from-state index.

Contrary to _m_lp_JAI above, this vector contains only 1 element,\ which can be the ANY_INDEX (_m_anyStateIndex) . This is more convenient, as it allows easier selection of the proper AddReward and AddObservation functions.

Referenced by DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::ProcessR::operator()().

int DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::_m_lp_int
std::vector<Index> DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::_m_lp_JA

A vector in which the currently parsed individual action indices of a joint action are stored.

(by StoreLPAction). wild-cards (asterik) are stored as _m_anyJAIndex .

Referenced by DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::StoreLPAction::operator()().

std::vector<Index> DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::_m_lp_JAI

A vector that stores the indices of joint actions that match the last parsed joint action.

(if the last parsed joint action didn't contain any wildcards, the size of this vector is 1.) This vector is constructed by StoreLPJointAction by transforming the above vector (_m_lp_JA).

std::vector<Index> DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::_m_lp_JO
std::vector<Index> DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::_m_lp_JOI

similar for the joint observations...

bool DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::_m_lp_number_negated

Whether the last optional sign was a '-'.

bool DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::_m_lp_number_used_opt_sign

Whether the last 'number' used an optional sign ('+' or '-')

bool DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::_m_startStateListExclude

A boolean indicating whether the states in the start state list should be excluded (versus the default: uniform prob.

over the specified states).

Referenced by DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::StartStateExludes::operator()(), ParserDPOMDPFormat_Spirit(), and DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::ProcessStartStateList::ProcessList().

std::vector<Index> DPOMDPFormatParsing::ParserDPOMDPFormat_Spirit::_m_startStateListSI