Browse Source

added shield expression class

tempestpy_adaptions
Stefan Pranger 4 years ago
parent
commit
5a2657346b
  1. 31
      src/storm/logic/ShieldExpression.cpp
  2. 34
      src/storm/logic/ShieldExpression.h

31
src/storm/logic/ShieldExpression.cpp

@ -0,0 +1,31 @@
#include "storm/logic/ShieldExpression.h"
namespace storm {
namespace logic {
ShieldExpression::ShieldExpression() {}
ShieldExpression::ShieldExpression(ShieldingType type, ShieldComparison comparison, double value) : type(type), comparison(comparison), value(value) {
//Intentionally left empty
}
bool ShieldExpression::isRelative() const {
return comparison == storm::logic::ShieldComparison::Relative;
}
bool ShieldExpression::isPreSafetyShield() const {
return type == storm::logic::ShieldingType::PreSafety;
}
bool ShieldExpression::isPostSafetyShield() const {
return type == storm::logic::ShieldingType::PostSafety;
}
bool ShieldExpression::isOptiomalShield() const {
return type == storm::logic::ShieldingType::Optimal;
}
double ShieldExpression::getValue() const {
return value;
}
}
}

34
src/storm/logic/ShieldExpression.h

@ -0,0 +1,34 @@
#pragma once
#include <memory>
namespace storm {
namespace logic {
enum class ShieldingType {
PostSafety,
PreSafety,
Optimal
};
enum class ShieldComparison { Absolute, Relative };
class ShieldExpression {
public:
ShieldExpression();
ShieldExpression(ShieldingType type, ShieldComparison comparison, double value);
bool isRelative() const;
bool isPreSafetyShield() const;
bool isPostSafetyShield() const;
bool isOptiomalShield() const;
double getValue() const;
private:
ShieldingType type;
ShieldComparison comparison;
double value;
};
}
}
Loading…
Cancel
Save