Browse Source

dontCareStates can now be (non)deterministic and (un)defined

Conflicts:
	src/storm/storage/Scheduler.h
tempestpy_adaptions
hannah 3 years ago
committed by Stefan Pranger
parent
commit
e5b19643e8
  1. 12
      src/storm/storage/Scheduler.cpp
  2. 9
      src/storm/storage/Scheduler.h

12
src/storm/storage/Scheduler.cpp

@ -35,7 +35,7 @@ namespace storm {
STORM_LOG_ASSERT(modelState < schedulerChoices[memoryState].size(), "Illegal model state index"); STORM_LOG_ASSERT(modelState < schedulerChoices[memoryState].size(), "Illegal model state index");
auto& schedulerChoice = schedulerChoices[memoryState][modelState]; auto& schedulerChoice = schedulerChoices[memoryState][modelState];
if (!dontCareStates[memoryState].get(modelState)) {
if (schedulerChoice.isDefined()) { if (schedulerChoice.isDefined()) {
if (!choice.isDefined()) { if (!choice.isDefined()) {
++numOfUndefinedChoices; ++numOfUndefinedChoices;
@ -56,7 +56,6 @@ namespace storm {
++numOfDeterministicChoices; ++numOfDeterministicChoices;
} }
} }
}
schedulerChoice = choice; schedulerChoice = choice;
} }
@ -87,13 +86,13 @@ namespace storm {
} }
template <typename ValueType> template <typename ValueType>
void Scheduler<ValueType>::setDontCare(uint_fast64_t modelState, uint_fast64_t memoryState) {
void Scheduler<ValueType>::setDontCare(uint_fast64_t modelState, uint_fast64_t memoryState, bool setArbitraryChoice) {
STORM_LOG_ASSERT(memoryState < getNumberOfMemoryStates(), "Illegal memory state index"); STORM_LOG_ASSERT(memoryState < getNumberOfMemoryStates(), "Illegal memory state index");
STORM_LOG_ASSERT(modelState < schedulerChoices[memoryState].size(), "Illegal model state index"); STORM_LOG_ASSERT(modelState < schedulerChoices[memoryState].size(), "Illegal model state index");
if (!dontCareStates[memoryState].get(modelState)) { if (!dontCareStates[memoryState].get(modelState)) {
auto& schedulerChoice = schedulerChoices[memoryState][modelState]; auto& schedulerChoice = schedulerChoices[memoryState][modelState];
if (!schedulerChoice.isDefined()) {
if (!schedulerChoice.isDefined() && setArbitraryChoice) {
// Set an arbitrary choice // Set an arbitrary choice
this->setChoice(0, modelState, memoryState); this->setChoice(0, modelState, memoryState);
} }
@ -108,13 +107,8 @@ namespace storm {
STORM_LOG_ASSERT(modelState < schedulerChoices[memoryState].size(), "Illegal model state index"); STORM_LOG_ASSERT(modelState < schedulerChoices[memoryState].size(), "Illegal model state index");
if (dontCareStates[memoryState].get(modelState)) { if (dontCareStates[memoryState].get(modelState)) {
auto& schedulerChoice = schedulerChoices[memoryState][modelState];
if (!schedulerChoice.isDefined()) {
++numOfUndefinedChoices;
}
dontCareStates[memoryState].set(modelState, false); dontCareStates[memoryState].set(modelState, false);
--numOfDontCareStates; --numOfDontCareStates;
} }
} }

9
src/storm/storage/Scheduler.h

@ -62,12 +62,13 @@ namespace storm {
/*! /*!
* Set the combination of model state and memoryStructure state to dontCare. * Set the combination of model state and memoryStructure state to dontCare.
* Set an arbitrary choice an arbitrary choice if no choice exists.
* If not specified otherwise, an arbitrary choice is set if no choice exists.
* *
* @param modelState The state of the model. * @param modelState The state of the model.
* @param memoryState The state of the memoryStructure. * @param memoryState The state of the memoryStructure.
* @param memoryState A flag indicating whether to set an arbitrary choice.
*/ */
void setDontCare(uint_fast64_t modelState, uint_fast64_t memoryState = 0);
void setDontCare(uint_fast64_t modelState, uint_fast64_t memoryState = 0, bool setArbitraryChoice = true);
/*! /*!
* Unset the combination of model state and memoryStructure state to dontCare. * Unset the combination of model state and memoryStructure state to dontCare.
@ -152,8 +153,8 @@ namespace storm {
bool printUndefinedChoices = false; bool printUndefinedChoices = false;
std::vector<storm::storage::BitVector> reachableStates; std::vector<storm::storage::BitVector> reachableStates;
uint_fast64_t numOfUndefinedChoices; // Only consider reachable ones
std::vector<storm::storage::BitVector> dontCareStates; // Their choices are neither considered deterministic nor undefined
std::vector<storm::storage::BitVector> dontCareStates;
uint_fast64_t numOfUndefinedChoices;
uint_fast64_t numOfDeterministicChoices; uint_fast64_t numOfDeterministicChoices;
uint_fast64_t numOfDontCareStates; uint_fast64_t numOfDontCareStates;
}; };

Loading…
Cancel
Save