home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tlx501.zip / SRC / PROBLREP.CPP < prev    next >
C/C++ Source or Header  |  1996-07-08  |  4KB  |  123 lines

  1. /****************************************************************************
  2.     $Id: problrep.cpp 501.0 1995/03/07 12:26:18 RON Exp $
  3.  
  4.     Copyright (c) 1991-95 Tarma Software Research. All rights reserved.
  5.  
  6.     Project:    Tarma Library for C++ V5.0
  7.     Author:    Ron van der Wal
  8.  
  9.     Implementation of class TLProblemRep.
  10.  
  11.     $Log: problrep.cpp $
  12.     Revision 501.0  1995/03/07 12:26:18  RON
  13.     Updated for TLX 5.01
  14.     Revision 1.14  1995/02/22 12:33:14  RON
  15.     Update for release 012
  16.     Added partial support for SunPro C++ compiler
  17.     Revision 1.13  1995/01/13  15:33:50  ron
  18.     Corrected Revision keyword
  19.  
  20.     Revision 1.12  1995/01/12  13:40:41  ron
  21.     Adapted to previous Searcher/ProblemRep model
  22.  
  23.     Revision 1.11  1995/01/05  15:26:16  ron
  24.     Naming changes
  25.  
  26.     Revision 1.10  1994/11/16  15:35:08  ron
  27.     Added module info; rearranged #include directives
  28.  
  29.     Revision 1.9  1994/10/13  11:50:02  ron
  30.     Moved PreProcess() to this source file
  31.  
  32.     Revision 1.8  1994/10/07  16:59:39  ron
  33.     Changed UnregisterSearcher() to DeregisterSearcher()
  34.  
  35.     Revision 1.7  1994/10/06  17:42:38  ron
  36.     Changed wording of destruction check
  37.  
  38.     Revision 1.6  1994/10/05  18:32:26  ron
  39.     Replaced destructor assertion with unlink operation + warning
  40.  
  41.     Revision 1.5  1994/09/28  14:11:49  ron
  42.     Added mSearcher data member
  43.  
  44.     Revision 1.4  1994/09/27  20:21:53  ron
  45.     Changed path separator from / to \
  46.  
  47.     Revision 1.3  1994/09/26  15:38:03  ron
  48.     Changed include file references
  49.  
  50.     Revision 1.2  1994/09/06  14:06:42  ron
  51.     Implemented InitialExpansion()
  52.  
  53.     Revision 1.1  1994/08/16  18:12:50  ron
  54.     Initial revision
  55.  
  56. ****************************************************************************/
  57.  
  58. #include <tlx\501\_build.h>
  59.  
  60. TLX_MODULE_INFO("$Revision: 501.0 $");
  61.  
  62. #include <tlx\501\solve\searcher.h>
  63.  
  64. /*-------------------------------------------------------------------------*/
  65.     TLProblemRep::TLProblemRep()
  66.  
  67. /*  Constructor. Clears data members.
  68. ---------------------------------------------------------------------------*/
  69. : mSearcher(0)
  70. {
  71. }
  72.  
  73. /*-------------------------------------------------------------------------*/
  74.     TLProblemRep::~TLProblemRep()
  75.  
  76. /*  Destructor. Checks that it is not currently linked to a searcher.
  77. ---------------------------------------------------------------------------*/
  78. {
  79.     if (mSearcher)
  80.     {
  81.     TLX_TRACE_ERROR(TLX, ("ProblemRep linked to Searcher on destruction"));
  82.     if (mSearcher->mProblemRep == this)
  83.         mSearcher->DeregisterProblemRep();
  84.         TLX_ASSERT_NULL(mSearcher);
  85.     }
  86. }
  87.  
  88. /*-------------------------------------------------------------------------*/
  89.     size_t TLProblemRep::CreateInitialProblem(TLProblemList &aList)
  90.  
  91. /*  Called to create the initial problems in the search tree. The default
  92.     implementation calls GenerateBranches() with an initial argument of 0.
  93. ---------------------------------------------------------------------------*/
  94. {
  95.     return GenerateBranches(0, aList);
  96. }
  97.  
  98. /*-------------------------------------------------------------------------*/
  99.     void TLProblemRep::LeaveState(TLProblemState *)
  100.  
  101. /*  Default clean-up step, which does nothing.
  102. ---------------------------------------------------------------------------*/
  103. {
  104. }
  105.  
  106. /*-------------------------------------------------------------------------*/
  107.     void TLProblemRep::PostProcess()
  108.  
  109. /*  Default postprocessing step, which does nothing.
  110. ---------------------------------------------------------------------------*/
  111. {
  112. }
  113.  
  114. /*-------------------------------------------------------------------------*/
  115.     bool TLProblemRep::PreProcess()
  116.  
  117. /*  Default preprocessing step, which will always succeed.
  118. ---------------------------------------------------------------------------*/
  119. {
  120.     return true;
  121. }
  122.  
  123.