Browse Source

some minor fixes, now with less memory errors :)

tempestpy_adaptions
gereon 12 years ago
parent
commit
c33d319ac3
  1. 10
      src/adapters/ExplicitModelAdapter.h

10
src/adapters/ExplicitModelAdapter.h

@ -142,7 +142,7 @@ private:
* @params update Update to be applied. * @params update Update to be applied.
* @return Resulting state. * @return Resulting state.
*/ */
StateType* applyUpdate(StateType const * state, storm::ir::Update const & update) {
StateType* applyUpdate(StateType const * const state, storm::ir::Update const & update) {
StateType* newState = new StateType(*state); StateType* newState = new StateType(*state);
for (auto assignedVariable : update.getBooleanAssignments()) { for (auto assignedVariable : update.getBooleanAssignments()) {
setValue(newState, this->booleanVariableToIndexMap[assignedVariable.first], assignedVariable.second.getExpression()->getValueAsBool(state)); setValue(newState, this->booleanVariableToIndexMap[assignedVariable.first], assignedVariable.second.getExpression()->getValueAsBool(state));
@ -245,16 +245,20 @@ private:
} }
} }
// Move new states to resultStates. // Move new states to resultStates.
resultStates = newStates;
// resultStates = newStates;
resultStates.clear();
resultStates.insert(newStates.begin(), newStates.end());
// Delete old result states. // Delete old result states.
while (!deleteQueue.empty()) { while (!deleteQueue.empty()) {
if (deleteQueue.front() != currentState) {
delete deleteQueue.front(); delete deleteQueue.front();
}
deleteQueue.pop(); deleteQueue.pop();
} }
} }
// Now add our final result states to our global result. // Now add our final result states to our global result.
for (auto it : resultStates) { for (auto it : resultStates) {
hasTransition = true;
auto s = stateToIndexMap.find(it.first); auto s = stateToIndexMap.find(it.first);
if (s == stateToIndexMap.end()) { if (s == stateToIndexMap.end()) {
stateQueue.push(it.first); stateQueue.push(it.first);

Loading…
Cancel
Save