|
@ -90,23 +90,35 @@ namespace storm { |
|
|
void Scheduler<ValueType>::setDontCare(uint_fast64_t modelState, uint_fast64_t memoryState) { |
|
|
void Scheduler<ValueType>::setDontCare(uint_fast64_t modelState, uint_fast64_t memoryState) { |
|
|
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"); |
|
|
auto& schedulerChoice = schedulerChoices[memoryState][modelState]; |
|
|
|
|
|
|
|
|
|
|
|
if (!dontCareStates[memoryState].get(modelState)) { |
|
|
if (!dontCareStates[memoryState].get(modelState)) { |
|
|
|
|
|
auto& schedulerChoice = schedulerChoices[memoryState][modelState]; |
|
|
|
|
|
if (!schedulerChoice.isDefined()) { |
|
|
|
|
|
// Set an arbitrary choice
|
|
|
|
|
|
this->setChoice(0, modelState, memoryState); |
|
|
|
|
|
} |
|
|
dontCareStates[memoryState].set(modelState, true); |
|
|
dontCareStates[memoryState].set(modelState, true); |
|
|
++numOfDontCareStates; |
|
|
++numOfDontCareStates; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// Choices for dontCare states are not considered undefined or deterministic
|
|
|
|
|
|
|
|
|
template <typename ValueType> |
|
|
|
|
|
void Scheduler<ValueType>::unSetDontCare(uint_fast64_t modelState, uint_fast64_t memoryState) { |
|
|
|
|
|
STORM_LOG_ASSERT(memoryState < getNumberOfMemoryStates(), "Illegal memory state index"); |
|
|
|
|
|
STORM_LOG_ASSERT(modelState < schedulerChoices[memoryState].size(), "Illegal model state index"); |
|
|
|
|
|
|
|
|
|
|
|
if (dontCareStates[memoryState].get(modelState)) { |
|
|
|
|
|
auto& schedulerChoice = schedulerChoices[memoryState][modelState]; |
|
|
if (!schedulerChoice.isDefined()) { |
|
|
if (!schedulerChoice.isDefined()) { |
|
|
--numOfUndefinedChoices; |
|
|
|
|
|
} else if (schedulerChoice.isDeterministic()) { |
|
|
|
|
|
--numOfDeterministicChoices; |
|
|
|
|
|
|
|
|
++numOfUndefinedChoices; |
|
|
} |
|
|
} |
|
|
|
|
|
dontCareStates[memoryState].set(modelState, false); |
|
|
|
|
|
--numOfDontCareStates; |
|
|
|
|
|
|
|
|
// Set an arbitrary choice
|
|
|
|
|
|
schedulerChoices[memoryState][modelState] = SchedulerChoice<ValueType>(0); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template <typename ValueType> |
|
|
template <typename ValueType> |
|
|
bool Scheduler<ValueType>::isDontCare(uint_fast64_t modelState, uint64_t memoryState) const { |
|
|
bool Scheduler<ValueType>::isDontCare(uint_fast64_t modelState, uint64_t memoryState) const { |
|
|
return dontCareStates[memoryState].get(modelState); |
|
|
return dontCareStates[memoryState].get(modelState); |
|
@ -137,7 +149,7 @@ namespace storm { |
|
|
|
|
|
|
|
|
template <typename ValueType> |
|
|
template <typename ValueType> |
|
|
bool Scheduler<ValueType>::isDeterministicScheduler() const { |
|
|
bool Scheduler<ValueType>::isDeterministicScheduler() const { |
|
|
return numOfDeterministicChoices == (schedulerChoices.size() * schedulerChoices.begin()->size()) - numOfUndefinedChoices - numOfDontCareStates; |
|
|
|
|
|
|
|
|
return numOfDeterministicChoices == (schedulerChoices.size() * schedulerChoices.begin()->size()) - numOfUndefinedChoices; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
template <typename ValueType> |
|
|
template <typename ValueType> |
|
|