|
|
@ -147,6 +147,7 @@ namespace storm { |
|
|
|
STORM_LOG_WARN_COND(!(skipUniqueChoices && model == nullptr), "Can not skip unique choices if the model is not given."); |
|
|
|
out << std::setw(widthOfStates) << "model state:" << " " << (isMemorylessScheduler() ? "" : " memory: ") << "choice(s)" << std::endl; |
|
|
|
for (uint_fast64_t state = 0; state < schedulerChoices.front().size(); ++state) { |
|
|
|
std::stringstream stateString; |
|
|
|
// Check whether the state is skipped
|
|
|
|
if (skipUniqueChoices && model != nullptr && model->getTransitionMatrix().getRowGroupSize(state) == 1) { |
|
|
|
++numOfSkippedStatesWithUniqueChoice; |
|
|
@ -155,11 +156,11 @@ namespace storm { |
|
|
|
|
|
|
|
// Print the state info
|
|
|
|
if (stateValuationsGiven) { |
|
|
|
out << std::setw(widthOfStates) << (std::to_string(state) + ": " + model->getStateValuations().getStateInfo(state)); |
|
|
|
stateString << std::setw(widthOfStates) << (std::to_string(state) + ": " + model->getStateValuations().getStateInfo(state)); |
|
|
|
} else { |
|
|
|
out << std::setw(widthOfStates) << state; |
|
|
|
stateString << std::setw(widthOfStates) << state; |
|
|
|
} |
|
|
|
out << " "; |
|
|
|
stateString << " "; |
|
|
|
|
|
|
|
bool firstMemoryState = true; |
|
|
|
for (uint_fast64_t memoryState = 0; memoryState < getNumberOfMemoryStates(); ++memoryState) { |
|
|
@ -167,12 +168,12 @@ namespace storm { |
|
|
|
if (firstMemoryState) { |
|
|
|
firstMemoryState = false; |
|
|
|
} else { |
|
|
|
out << std::setw(widthOfStates) << ""; |
|
|
|
out << " "; |
|
|
|
stateString << std::setw(widthOfStates) << ""; |
|
|
|
stateString << " "; |
|
|
|
} |
|
|
|
// Print the memory state info
|
|
|
|
if (!isMemorylessScheduler()) { |
|
|
|
out << "m" << std::setw(8) << memoryState; |
|
|
|
stateString << "m" << std::setw(8) << memoryState; |
|
|
|
} |
|
|
|
|
|
|
|
// Print choice info
|
|
|
@ -180,13 +181,13 @@ namespace storm { |
|
|
|
if (choice.isDefined()) { |
|
|
|
if (choice.isDeterministic()) { |
|
|
|
if (choiceOriginsGiven) { |
|
|
|
out << model->getChoiceOrigins()->getChoiceInfo(model->getTransitionMatrix().getRowGroupIndices()[state] + choice.getDeterministicChoice()); |
|
|
|
stateString << model->getChoiceOrigins()->getChoiceInfo(model->getTransitionMatrix().getRowGroupIndices()[state] + choice.getDeterministicChoice()); |
|
|
|
} else { |
|
|
|
out << choice.getDeterministicChoice(); |
|
|
|
stateString << choice.getDeterministicChoice(); |
|
|
|
} |
|
|
|
if (choiceLabelsGiven) { |
|
|
|
auto choiceLabels = model->getChoiceLabeling().getLabelsOfChoice(model->getTransitionMatrix().getRowGroupIndices()[state] + choice.getDeterministicChoice()); |
|
|
|
out << " {" << boost::join(choiceLabels, ", ") << "}"; |
|
|
|
stateString << " {" << boost::join(choiceLabels, ", ") << "}"; |
|
|
|
} |
|
|
|
} else { |
|
|
|
bool firstChoice = true; |
|
|
@ -194,26 +195,28 @@ namespace storm { |
|
|
|
if (firstChoice) { |
|
|
|
firstChoice = false; |
|
|
|
} else { |
|
|
|
out << " + "; |
|
|
|
stateString << " + "; |
|
|
|
} |
|
|
|
out << choiceProbPair.second << ": ("; |
|
|
|
stateString << choiceProbPair.second << ": ("; |
|
|
|
if (choiceOriginsGiven) { |
|
|
|
out << model->getChoiceOrigins()->getChoiceInfo(model->getTransitionMatrix().getRowGroupIndices()[state] + choiceProbPair.first); |
|
|
|
stateString << model->getChoiceOrigins()->getChoiceInfo(model->getTransitionMatrix().getRowGroupIndices()[state] + choiceProbPair.first); |
|
|
|
} else { |
|
|
|
out << choiceProbPair.first; |
|
|
|
stateString << choiceProbPair.first; |
|
|
|
} |
|
|
|
if (choiceLabelsGiven) { |
|
|
|
auto choiceLabels = model->getChoiceLabeling().getLabelsOfChoice(model->getTransitionMatrix().getRowGroupIndices()[state] + choice.getDeterministicChoice()); |
|
|
|
out << " {" << boost::join(choiceLabels, ", ") << "}"; |
|
|
|
stateString << " {" << boost::join(choiceLabels, ", ") << "}"; |
|
|
|
} |
|
|
|
out << ")"; |
|
|
|
stateString << ")"; |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
out << "undefined."; |
|
|
|
if(!printUndefinedChoices) continue; |
|
|
|
stateString << "undefined."; |
|
|
|
} |
|
|
|
|
|
|
|
// Todo: print memory updates
|
|
|
|
out << stateString.str(); |
|
|
|
out << std::endl; |
|
|
|
} |
|
|
|
} |
|
|
@ -271,6 +274,11 @@ namespace storm { |
|
|
|
out << output.dump(4); |
|
|
|
} |
|
|
|
|
|
|
|
template <typename ValueType> |
|
|
|
void Scheduler<ValueType>::setPrintUndefinedChoices(bool value) { |
|
|
|
printUndefinedChoices = value; |
|
|
|
} |
|
|
|
|
|
|
|
template class Scheduler<double>; |
|
|
|
template class Scheduler<float>; |
|
|
|
template class Scheduler<storm::RationalNumber>; |
|
|
|