Browse Source

Fixed weird error from previous commit.

tempestpy_adaptions
gereon 12 years ago
parent
commit
5840ca5bab
  1. 13
      src/parser/PrismParser/VariableState.cpp

13
src/parser/PrismParser/VariableState.cpp

@ -53,9 +53,6 @@ uint_fast64_t VariableState::addIntegerVariable(const std::string& name, const s
std::shared_ptr<VariableExpression> varExpr = std::shared_ptr<VariableExpression>(new VariableExpression(storm::ir::expressions::BaseExpression::int_, this->nextIntegerVariableIndex, name, lower, upper)); std::shared_ptr<VariableExpression> varExpr = std::shared_ptr<VariableExpression>(new VariableExpression(storm::ir::expressions::BaseExpression::int_, this->nextIntegerVariableIndex, name, lower, upper));
LOG4CPLUS_DEBUG(logger, "Adding integer variable " << name << " with new id " << this->nextIntegerVariableIndex); LOG4CPLUS_DEBUG(logger, "Adding integer variable " << name << " with new id " << this->nextIntegerVariableIndex);
this->integerVariables_.add(name, varExpr); this->integerVariables_.add(name, varExpr);
LOG4CPLUS_DEBUG(logger, "Int variables: " << this->integerVariables_);
this->integerVariables_.at(name) = varExpr;
LOG4CPLUS_DEBUG(logger, "Int variables: " << this->integerVariables_);
this->integerVariableNames_.add(name, name); this->integerVariableNames_.add(name, name);
this->nextIntegerVariableIndex++; this->nextIntegerVariableIndex++;
return varExpr->getVariableIndex(); return varExpr->getVariableIndex();
@ -72,10 +69,9 @@ uint_fast64_t VariableState::addIntegerVariable(const std::string& name, const s
} }
std::shared_ptr<VariableExpression> VariableState::getBooleanVariable(const std::string& name) { std::shared_ptr<VariableExpression> VariableState::getBooleanVariable(const std::string& name) {
std::shared_ptr<VariableExpression> res = this->booleanVariables_.at(name);
std::shared_ptr<VariableExpression>* res = this->booleanVariables_.find(name);
if (res != nullptr) { if (res != nullptr) {
LOG4CPLUS_DEBUG(logger, "Getting boolean variable " << name << ", was found at " << res);
return res;
return *res;
} else { } else {
if (firstRun) { if (firstRun) {
LOG4CPLUS_DEBUG(logger, "Getting boolean variable " << name << ", was not yet created."); LOG4CPLUS_DEBUG(logger, "Getting boolean variable " << name << ", was not yet created.");
@ -88,10 +84,9 @@ std::shared_ptr<VariableExpression> VariableState::getBooleanVariable(const std:
} }
std::shared_ptr<VariableExpression> VariableState::getIntegerVariable(const std::string& name) { std::shared_ptr<VariableExpression> VariableState::getIntegerVariable(const std::string& name) {
std::shared_ptr<VariableExpression> res = this->integerVariables_.at(name);
std::shared_ptr<VariableExpression>* res = this->integerVariables_.find(name);
if (res != nullptr) { if (res != nullptr) {
LOG4CPLUS_DEBUG(logger, "Getting integer variable " << name << ", was found at " << res);
return res;
return *res;
} else { } else {
if (firstRun) { if (firstRun) {
LOG4CPLUS_DEBUG(logger, "Getting integer variable " << name << ", was not yet created."); LOG4CPLUS_DEBUG(logger, "Getting integer variable " << name << ", was not yet created.");

Loading…
Cancel
Save