Exemplo n.º 1
0
SystemVariable* VariableModelManager::requestSystemVariable(QString name, QString filter)
{
    // Should I initialize the variable

    if (!m_list.contains(name)){

        m_list.insert(name, new SystemVariable(name, "", filter,this));

        if (m_serverAvailable)
            emit requestVariable(name,filter);
    }

    // Getting current variable registered

    SystemVariable* str = m_list.value(name);

    // Checking if the filter has changed

    if (str->option() != filter){

        str->setOption(filter);
        str->setVariable("");

        if (m_serverAvailable)
            emit requestVariable(name,filter);
    }

    // Returning the variable

    return str;
}
Exemplo n.º 2
0
void VariableModelManager::updateModel()
{
    log("Requesting full update of model");

    foreach (SystemVariable *var, m_list) {

        emit requestVariable(var->name(),var->option());
    }
Exemplo n.º 3
0
ArithVar SimplexDecisionProcedure::constructInfeasiblityFunction(TimerStat& timer, const ArithVarVec& set){
  Debug("constructInfeasiblityFunction") << "constructInfeasiblityFunction start" << endl;

  TimerStat::CodeTimer codeTimer(timer);
  Assert(!d_errorSet.focusEmpty());
  Assert(debugIsASet(set));
  
  ArithVar inf = requestVariable();
  Assert(inf != ARITHVAR_SENTINEL);

  std::vector<Rational> coeffs;
  std::vector<ArithVar> variables;

  for(ArithVarVec::const_iterator iter = set.begin(), iend = set.end(); iter != iend; ++iter){
    ArithVar e = *iter;

    Assert(d_tableau.isBasic(e));
    Assert(!d_variables.assignmentIsConsistent(e));

    int sgn = d_errorSet.getSgn(e);
    Assert(sgn == -1 || sgn == 1);
    const Rational& violatedCoeff = sgn < 0 ? d_negOne : d_posOne;
    coeffs.push_back(violatedCoeff);
    variables.push_back(e);

    Debug("constructInfeasiblityFunction") << violatedCoeff << " " << e << endl;

  }
  d_tableau.addRow(inf, coeffs, variables);
  DeltaRational newAssignment = d_linEq.computeRowValue(inf, false);
  d_variables.setAssignment(inf, newAssignment);

  //d_linEq.trackVariable(inf);
  d_linEq.trackRowIndex(d_tableau.basicToRowIndex(inf));

  Debug("constructInfeasiblityFunction") << inf << " " << newAssignment << endl;
  Debug("constructInfeasiblityFunction") << "constructInfeasiblityFunction done" << endl;
  return inf;
}