Skip to content

Commit

Permalink
Support for smc semantics parameter parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
tand00 committed May 8, 2024
1 parent 60e5996 commit 4d23274
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions include/PQL/SMCExpressions.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ namespace unfoldtacpn::PQL {

struct SMCSettings {
enum SMCBoundType { TimeBound, StepBound };
enum SMCSemantics { Weak, Strong };
SMCBoundType boundType;
int bound;
float falsePositives;
Expand All @@ -18,6 +19,7 @@ namespace unfoldtacpn::PQL {
float estimationIntervalWidth;
bool compareToFloat;
float geqThan;
SMCSemantics semantics;
};

class ProbaCondition : public SimpleQuantifierCondition {
Expand Down
6 changes: 5 additions & 1 deletion src/PetriParse/QueryXMLParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,11 +465,15 @@ SMCSettings QueryXMLParser::parseSmcSettings(rapidxml::xml_node<>* smcNode) {
0.05f, 0.05f,
0.1f,
0.95f, 0.05f,
false, 0.0f
false, 0.0f,
SMCSettings::Weak
};
auto boundType = smcNode->first_attribute("bound-type");
if(boundType != nullptr)
settings.boundType = strcmp(boundType->value(), "time") == 0 ? SMCSettings::TimeBound : SMCSettings::StepBound;
auto semantics = smcNode->first_attribute("semantics");
if(semantics != nullptr)
settings.semantics = strcmp(boundType->value(), "strong") == 0 ? SMCSettings::Strong : SMCSettings::Weak;
auto boundValue = smcNode->first_attribute("bound");
if(boundValue != nullptr)
settings.bound = atoi(boundValue->value());
Expand Down

0 comments on commit 4d23274

Please sign in to comment.