From 54209ce44eb090da3afde82bc92757ce0026445a Mon Sep 17 00:00:00 2001 From: Filip Macak Date: Wed, 14 Feb 2024 16:12:58 +0100 Subject: [PATCH] Fixed the MADP parser to parse 'start include/exclude' according to POMDP.org --- .../src/parser/ParserPOMDPFormat_Spirit.h | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/payntbind/src/synthesis/decpomdp/madp/src/parser/ParserPOMDPFormat_Spirit.h b/payntbind/src/synthesis/decpomdp/madp/src/parser/ParserPOMDPFormat_Spirit.h index c3b3ab0f0..f544e6d46 100644 --- a/payntbind/src/synthesis/decpomdp/madp/src/parser/ParserPOMDPFormat_Spirit.h +++ b/payntbind/src/synthesis/decpomdp/madp/src/parser/ParserPOMDPFormat_Spirit.h @@ -326,23 +326,30 @@ class ParserPOMDPFormat_Spirit : AddStartState (ParserPOMDPFormat_Spirit* po){_m_po = po;} void operator()(iterator_t str, iterator_t end) const { - if(_m_po->_m_lp_type != STRING) - { - std::stringstream ss; ss << "SetStartState::operator()(iterator_t str, iterator_t end) - expected a string as last parsed type! (at"<_m_lp_type == UINT) { - Index sI = _m_po->GetPOMDPDiscrete()->GetStateIndexByName( - _m_po->_m_lp_string); - _m_po->_m_startStateListSI.push_back(sI); + _m_po->_m_startStateListSI.push_back(_m_po->_m_lp_uint); } - catch(E e) + else if(_m_po->_m_lp_type != STRING) { - std::stringstream ss; ss << e.SoftPrint() << "(at"<< - str.get_position() <<")"<GetPOMDPDiscrete()->GetStateIndexByName( + _m_po->_m_lp_string); + _m_po->_m_startStateListSI.push_back(sI); + } + catch(E e) + { + std::stringstream ss; ss << e.SoftPrint() << "(at"<< + str.get_position() <<")"<