7 changed files with 77 additions and 21 deletions
-
11src/storm/builder/BuilderOptions.cpp
-
5src/storm/builder/BuilderOptions.h
-
7src/storm/builder/ExplicitModelBuilder.cpp
-
13src/storm/builder/ExplicitModelBuilder.h
-
2src/storm/models/sparse/StateAnnotation.h
-
32src/storm/storage/sparse/StateValuations.cpp
-
28src/storm/storage/sparse/StateValuations.h
@ -1,17 +1,43 @@ |
|||||
#include "storm/storage/sparse/StateValuations.h"
|
#include "storm/storage/sparse/StateValuations.h"
|
||||
|
|
||||
|
#include "storm/utility/vector.h"
|
||||
|
|
||||
namespace storm { |
namespace storm { |
||||
namespace storage { |
namespace storage { |
||||
namespace sparse { |
namespace sparse { |
||||
|
|
||||
StateValuations::StateValuations(state_type const& numberOfStates) : valuations(numberOfStates) { |
|
||||
|
StateValuations::StateValuations(std::vector<storm::expressions::SimpleValuation> const& valuations) : valuations(valuations) { |
||||
|
// Intentionally left empty.
|
||||
|
} |
||||
|
|
||||
|
StateValuations::StateValuations(std::vector<storm::expressions::SimpleValuation>&& valuations) : valuations(std::move(valuations)) { |
||||
// Intentionally left empty.
|
// Intentionally left empty.
|
||||
} |
} |
||||
|
|
||||
std::string StateValuations::stateInfo(state_type const& state) const { |
|
||||
return valuations[state].toString(); |
|
||||
|
std::string StateValuations::getStateInfo(state_type const& state) const { |
||||
|
return getStateValuation(state).toString(); |
||||
|
} |
||||
|
|
||||
|
storm::expressions::SimpleValuation const& StateValuations::getStateValuation(storm::storage::sparse::state_type const& state) const { |
||||
|
return valuations[state]; |
||||
} |
} |
||||
|
|
||||
|
StateValuations StateValuations::selectStates(storm::storage::BitVector const& selectedStates) const { |
||||
|
return StateValuations(storm::utility::vector::filterVector(valuations, selectedStates)); |
||||
|
} |
||||
|
|
||||
|
StateValuations StateValuations::selectStates(std::vector<storm::storage::sparse::state_type> const& selectedStates) const { |
||||
|
std::vector<storm::expressions::SimpleValuation> selectedValuations; |
||||
|
selectedValuations.reserve(selectedStates.size()); |
||||
|
for (auto const& selectedState : selectedStates){ |
||||
|
if (selectedState < valuations.size()) { |
||||
|
selectedValuations.push_back(valuations[selectedState]); |
||||
|
} else { |
||||
|
selectedValuations.emplace_back(); |
||||
|
} |
||||
|
} |
||||
|
return StateValuations(std::move(selectedValuations)); |
||||
|
} |
||||
} |
} |
||||
} |
} |
||||
} |
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue