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

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

Description (last modified by Pedro Gea)

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 (6)

comment:1 Changed 15 years ago by lmperez

Component: Definición de ParámetrosGeneral
Milestone: Strategy & Adapter 0.5
Owner: changed from Pedro Gea to josp
Priority: criticalmajor

comment:2 Changed 15 years ago by Pedro Gea

Description: modified (diff)
Milestone: Release 0.5Release 0.6
version: 0.50.6

comment:3 Changed 15 years ago by Pedro Gea

Component: GeneralTests

comment:4 Changed 15 years ago by Pedro Gea

Owner: changed from josp to Pedro Gea
Status: newaccepted

comment:5 Changed 15 years ago by Pedro Gea

(In [1958]) Se introduce el atributo "valor inicial" para las m-equivalencias, así todo m-elemento dispone de un método GetInitialValue (sólo para la m-combinación no es un atributo).

Las restricciones se comprueban para todo m-elemento (parámetro, m-combinación o m-equivalencia).

Para evitar que se introduzcan valores iniciales y restricciones incompatibles sólo queda comprobar las restricciones sobre combinaciones cuando el valor inicial de un parámetro cambia.

Ya que los valores iniciales pueden "omitirse", podrían establecerse restricciones de modo que el espacio de soluciones fuese vacío.

Refs #78

comment:6 Changed 13 years ago by Claudia Escalonilla

Milestone: Development 1ADev.1 Diagnosis
sensitive: 0
Note: See TracTickets for help on using tickets.