close Warning: Can't synchronize with repository "(default)" (/var/svn/mms does not appear to be a Subversion repository.). Look in the Trac log for more information.

Opened 15 years ago

Last modified 13 years ago

#78 accepted task

Intersección de restricciones de orden distinta de vacío — at Initial Version

Reported by: lmperez Owned by: Pedro Gea
Priority: major Milestone: Dev.1 Diagnosis
Component: Tests Keywords:
Cc:

Description

Comprobar que las condiciones iniciales de muestreo de los parámetros
cumplen las inecuaciones de las restricciones de orden.

Os dejo el código de bsrlayer que hace esta comprobación por si os sirve
de guía:

//////////////////////////////////////////////////////////////////////////////
Set CheckCnsTrntLinCmb (Text model, Real vl_mix, Set AllConstraintInfo)
//////////////////////////////////////////////////////////////////////////////
{
  // Traemos los puntos inciales de cada parámetro.
  Set check =  EvalSet (AllConstraintInfo, Real (Set s)
  {
   // Recorremos ecuaciones
    Set sthis.equ = Traspose(EvalSet (s, Set (Set se)
    {
      Text _.id_parameter = se[5];
      Real _.id_level     = se[6];
      Text _.id_node      = se[4];
      Real _.coef         = se[7];
      Real _.ini_val      =
InivalInfo(model,_.id_parameter,_.id_level,_.id_node);

      [[ _.coef*If(BinEQ(_.ini_val,?),0,_.ini_val) ]]
    }))[1];

    Real leftbound  = s[1][2];
    Real rightbound = s[1][3];

    // Chequeo de cada ecuación.
    Real value = SetSum (sthis.equ);

    Real If (And(If(BinEQ(rightbound,?),value < 1/0, value <= rightbound),
                 If(BinEQ(leftbound,?), value > -1/0,value >= leftbound)),
    {
      0
    },
    {
      WriteLn ("Wrong inequation "+IntText(s[1][1]),"W");
      s[1][1]
    })
  });
  Set Select(check,Real (Real x){ If(x==0,0,1) })
};
//////////////////////////////////////////////////////////////////////////////
PutDescription("It evals if the constraints of a model are ok. If not, it
gives you the set of inequations that are not correct.",
CheckCnsTrntLinCmb);
//////////////////////////////////////////////////////////////////////////////

Change History (0)

Note: See TracTickets for help on using tickets.