Browse Source

fixed some bugs here and there

Former-commit-id: 0dbedbb011 [formerly 5a4bce00e8]
Former-commit-id: 7dd87b1155
tempestpy_adaptions
dehnert 8 years ago
parent
commit
d2af83a98a
  1. 1
      src/builder/DdJaniModelBuilder.cpp
  2. 7
      src/storage/dd/Dd.cpp
  3. 4
      src/storage/dd/Dd.h
  4. 4
      src/storage/jani/Automaton.h
  5. 15
      src/storage/jani/CompositionActionInformationVisitor.cpp
  6. 4
      src/storage/jani/CompositionActionInformationVisitor.h
  7. 6
      src/storage/sparse/StateValuations.cpp
  8. 4
      src/storage/sparse/StateValuations.h

1
src/builder/DdJaniModelBuilder.cpp

@ -1032,6 +1032,7 @@ namespace storm {
for (auto const& actionIndex : actionInformation.getNonSilentActionIndices()) {
actionIndexToLocalNondeterminismVariableOffset[actionIndex] = 0;
}
actionIndexToLocalNondeterminismVariableOffset[actionInformation.getSilentActionIndex()] = 0;
AutomatonDd globalAutomaton = boost::any_cast<AutomatonDd>(this->model.getSystemComposition().accept(*this, actionIndexToLocalNondeterminismVariableOffset));
return buildSystemFromAutomaton(globalAutomaton);

7
src/storage/dd/Dd.cpp

@ -14,6 +14,11 @@ namespace storm {
// Intentionally left empty.
}
template<DdType LibraryType>
Dd<LibraryType>::~Dd() {
// Intentionally left empty.
}
template<DdType LibraryType>
bool Dd<LibraryType>::containsMetaVariable(storm::expressions::Variable const& metaVariable) const {
return containedMetaVariables.find(metaVariable) != containedMetaVariables.end();
@ -87,4 +92,4 @@ namespace storm {
template class Dd<storm::dd::DdType::CUDD>;
template class Dd<storm::dd::DdType::Sylvan>;
}
}
}

4
src/storage/dd/Dd.h

@ -30,6 +30,8 @@ namespace storm {
Dd(Dd<LibraryType>&& other) = default;
Dd& operator=(Dd<LibraryType>&& other) = default;
virtual ~Dd();
/*!
* Retrieves the support of the current DD.
*
@ -181,4 +183,4 @@ namespace storm {
}
}
#endif /* STORM_STORAGE_DD_DD_H_ */
#endif /* STORM_STORAGE_DD_DD_H_ */

4
src/storage/jani/Automaton.h

@ -298,7 +298,7 @@ namespace storm {
* Retrieves the action indices appearing at some edge of the automaton.
*/
std::set<uint64_t> getUsedActionIndices() const;
private:
/// The name of the automaton.
std::string name;
@ -330,4 +330,4 @@ namespace storm {
};
}
}
}

15
src/storage/jani/CompositionActionInformationVisitor.cpp

@ -6,7 +6,7 @@
namespace storm {
namespace jani {
ActionInformation::ActionInformation(std::set<uint64_t> const& nonsilentActionIndices, std::map<uint64_t, std::string> const& indexToNameMap, std::map<std::string, uint64_t> const& nameToIndexMap) : nonsilentActionIndices(nonsilentActionIndices), indexToNameMap(indexToNameMap), nameToIndexMap(nameToIndexMap) {
ActionInformation::ActionInformation(std::set<uint64_t> const& nonsilentActionIndices, std::map<uint64_t, std::string> const& indexToNameMap, std::map<std::string, uint64_t> const& nameToIndexMap, uint64_t silentActionIndex) : silentActionIndex(silentActionIndex), nonsilentActionIndices(nonsilentActionIndices), indexToNameMap(indexToNameMap), nameToIndexMap(nameToIndexMap) {
// Intentionally left empty.
}
@ -21,6 +21,10 @@ namespace storm {
std::set<uint64_t> const& ActionInformation::getNonSilentActionIndices() const {
return nonsilentActionIndices;
}
uint64_t ActionInformation::getSilentActionIndex() const {
return silentActionIndex;
}
CompositionActionInformationVisitor::CompositionActionInformationVisitor(storm::jani::Model const& model) : model(model), nextFreeActionIndex(0), nameToIndexMap(), indexToNameMap() {
// Intentionally left empty.
@ -32,6 +36,11 @@ namespace storm {
// Determine the next free index we can give out to a new action.
for (auto const& action : model.getActions()) {
uint64_t actionIndex = model.getActionIndex(action.getName());
nameToIndexMap[action.getName()] = model.getActionIndex(action.getName());
indexToNameMap[actionIndex] = action.getName();
nextFreeActionIndex = std::max(nextFreeActionIndex, model.getActionIndex(action.getName()));
}
++nextFreeActionIndex;
@ -42,7 +51,9 @@ namespace storm {
}
boost::any CompositionActionInformationVisitor::visit(AutomatonComposition const& composition, boost::any const& data) {
return model.getAutomaton(composition.getAutomatonName()).getUsedActionIndices();
std::set<uint64_t> result = model.getAutomaton(composition.getAutomatonName()).getUsedActionIndices();
result.erase(model.getSilentActionIndex());
return result;
}
boost::any CompositionActionInformationVisitor::visit(RenameComposition const& composition, boost::any const& data) {

4
src/storage/jani/CompositionActionInformationVisitor.h

@ -12,13 +12,15 @@ namespace storm {
class ActionInformation {
public:
ActionInformation(std::set<uint64_t> const& nonsilentActionIndices, std::map<uint64_t, std::string> const& indexToNameMap, std::map<std::string, uint64_t> const& nameToIndexMap);
ActionInformation(std::set<uint64_t> const& nonsilentActionIndices, std::map<uint64_t, std::string> const& indexToNameMap, std::map<std::string, uint64_t> const& nameToIndexMap, uint64_t silentActionIndex = 0);
std::string const& getActionName(uint64_t index) const;
uint64_t getActionIndex(std::string const& name) const;
std::set<uint64_t> const& getNonSilentActionIndices() const;
uint64_t getSilentActionIndex() const;
private:
uint64_t silentActionIndex;
std::set<uint64_t> nonsilentActionIndices;
std::map<uint64_t, std::string> indexToNameMap;
std::map<std::string, uint64_t> nameToIndexMap;

6
src/storage/sparse/StateValuations.cpp

@ -8,10 +8,14 @@ namespace storm {
// Intentionally left empty.
}
StateValuations::~StateValuations() {
// Intentionally left empty.
}
std::string StateValuations::stateInfo(state_type const& state) const {
return valuations[state].toString();
}
}
}
}
}

4
src/storage/sparse/StateValuations.h

@ -20,6 +20,8 @@ namespace storm {
*/
StateValuations(state_type const& numberOfStates);
virtual ~StateValuations();
// A mapping from state indices to their variable valuations.
std::vector<storm::expressions::SimpleValuation> valuations;
@ -30,4 +32,4 @@ namespace storm {
}
}
#endif /* STORM_STORAGE_SPARSE_STATEVALUATIONS_H_ */
#endif /* STORM_STORAGE_SPARSE_STATEVALUATIONS_H_ */
Loading…
Cancel
Save