11 changed files with 162 additions and 16 deletions
-
6src/storm/logic/BoundedUntilFormula.cpp
-
6src/storm/logic/CloneVisitor.cpp
-
22src/storm/logic/CumulativeRewardFormula.cpp
-
9src/storm/logic/CumulativeRewardFormula.h
-
13src/storm/logic/EventuallyFormula.cpp
-
8src/storm/logic/EventuallyFormula.h
-
47src/storm/logic/RewardAccumulation.cpp
-
24src/storm/logic/RewardAccumulation.h
-
20src/storm/logic/TimeBoundType.h
-
10src/storm/logic/TotalRewardFormula.cpp
-
13src/storm/logic/TotalRewardFormula.h
@ -0,0 +1,47 @@ |
|||
#include "storm/logic/RewardAccumulation.h"
|
|||
|
|||
namespace storm { |
|||
namespace logic { |
|||
|
|||
RewardAccumulation::RewardAccumulation(bool steps, bool time, bool exit) : steps(steps), time(time), exit(exit){ |
|||
// Intentionally left empty
|
|||
} |
|||
|
|||
bool RewardAccumulation::isStepsSet() const { |
|||
return steps; |
|||
} |
|||
|
|||
bool RewardAccumulation::isTimeSet() const { |
|||
return time; |
|||
} |
|||
|
|||
bool RewardAccumulation::isExitSet() const { |
|||
return exit; |
|||
} |
|||
|
|||
std::ostream& operator<<(std::ostream& out, RewardAccumulation const& acc) { |
|||
bool hasEntry = false; |
|||
if (acc.isStepsSet()) { |
|||
out << "steps"; |
|||
hasEntry = true; |
|||
} |
|||
if (acc.isTimeSet()) { |
|||
if (hasEntry) { |
|||
out << ", "; |
|||
} |
|||
out << "time"; |
|||
hasEntry = true; |
|||
} |
|||
if (acc.isExitSet()) { |
|||
if (hasEntry) { |
|||
out << ", "; |
|||
} |
|||
out << "exit"; |
|||
hasEntry = true; |
|||
} |
|||
|
|||
return out; |
|||
} |
|||
|
|||
} |
|||
} |
@ -0,0 +1,24 @@ |
|||
#pragma once |
|||
#include <iostream> |
|||
|
|||
namespace storm { |
|||
namespace logic { |
|||
|
|||
class RewardAccumulation { |
|||
public: |
|||
RewardAccumulation(bool steps, bool time, bool exit); |
|||
RewardAccumulation(RewardAccumulation const& other) = default; |
|||
|
|||
bool isStepsSet() const; // If set, choice rewards and transition rewards are accumulated upon taking the transition |
|||
bool isTimeSet() const; // If set, state rewards are accumulated over time (assuming 0 time passes in discrete-time model states) |
|||
bool isExitSet() const; // If set, state rewards are accumulated upon exiting the state |
|||
|
|||
private: |
|||
bool time, steps, exit; |
|||
}; |
|||
|
|||
std::ostream& operator<<(std::ostream& out, RewardAccumulation const& acc); |
|||
|
|||
} |
|||
} |
|||
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue