// Assert whether the variable does not exist yet.
// Due to incremental usage (push(), pop()), a variable might be declared in the manager but not in the lp model.
STORM_LOG_ASSERT(variableToIndexMap.count(variable)==0,"Variable "<<variable<<" exists already in the model.");
STORM_LOG_ASSERT(variableToIndexMap.count(variable)==0,"Variable "<<variable.getName()<<" exists already in the model.");
// Check for valid variable type.
STORM_LOG_ASSERT(variableType==GRB_CONTINUOUS||variableType==GRB_INTEGER||variableType==GRB_BINARY,"Illegal type '"<<variableType<<"' for Gurobi variable.");
STORM_LOG_THROW(!checkName||isValidVariableName(name),storm::exceptions::InvalidArgumentException,"Invalid variable name '"<<name<<"'.");
autonameIndexPair=nameToIndexMapping.find(name);
if(nameIndexPair!=nameToIndexMapping.end()){
STORM_LOG_ASSERT(indexToTypeMapping.at(nameIndexPair->second)==variableType,"Tried to declareOrGet variable '"<<name<<"' of type '"<<variableType<<"' but there is a variable with that name and different type '"<<indexToTypeMapping.at(nameIndexPair->second)"'.");
STORM_LOG_ASSERT(indexToTypeMapping.at(nameIndexPair->second)==variableType,"Tried to declareOrGet variable '"<<name<<"' of type '"<<variableType<<"' but there is a variable with that name and different type '"<<indexToTypeMapping.at(nameIndexPair->second)<<"'.");