Problems due to bad network structure in PNL

  • BrettC

    BrettC - 2007-08-30

    Using PNL High API (via C++), I am having problems saving a LIMID after adding two time slices complete with chance, decision, and utility nodes plus all arcs.  The network is topologically sorted.  I get the following error when I try to save the network:

    inconsistent size in pnlTabularDistribFun.cpp at line 457. The error description is:  number of ranges of matrix should coincide with the number of nodes in domain

    What does this error mean?


    • BrettC

      BrettC - 2007-08-30

      I should have noted that, in addition to being unable to save the network, I cannot do analysis on it, e. g. exp = net->GetExpectation() generates the same error msg.

    • BrettC

      BrettC - 2007-08-30

      I'm sure the bug is on my side, but this is the relevant code in pnlTabularDistribFun.cpp (it throws the exception at the end of this code snippet) :

      void CTabularDistribFun::AttachMatrix( CMatrix<float>* pMatrix,
                                              EMatrixType mType,
                                              int numberOfWeightMatrix,
                                              const int* parentIndices,
          if( m_bUnitFunctionDistribution )
              PNL_THROW( CInvalidOperation,
                  " matrices can't be attached to uniform distribution function " );

          void* pObj = this;

          if( ( mType != matTable ) && ( mType != matDirichlet ) )
              PNL_THROW( CInconsistentType,
                  " matrix type should be either matTable or matDirichlet " );

          //check ranges of matrix
          int        numRanges;
          const int* ranges;

          pMatrix->GetRanges( &numRanges, &ranges );

          if( numRanges != m_NumberOfNodes )
              PNL_THROW( CInconsistentSize,
                  " number of ranges of matrix should coincide"
                  " with the number of nodes in domain " );

    • BrettC

      BrettC - 2007-09-03

      This turned out to be due to linking 3 correctly-structured utility nodes to a single mega-utility node.  While this is sometimes done in the Decision Network literature, it is not possible to do in PNL (and arguably it doesn't make sense to do so given its utility semantics).

      I think the PNL High API needs its own error messages, since the ones given by the lower-level PNL library assume knowledge of its inner workings.


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks