Main Page | Class Hierarchy | Class List | File List | Class Members

IDC.h

00001 // IDC.h -- The IDC[[-MC]-PDS] decomposition algorithms interface.
00002 
00003 /*
00004  * Copyright (C) 1997, 1998 Tudor Hulubei <tudor@hulubei.net>.
00005  *
00006  * This library is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU Lesser General Public License as
00008  * published by the Free Software Foundation; either version 2, or (at
00009  * your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA,
00019  * 02111-1307, USA.
00020  */
00021 
00022 // $Id: IDC_8h-source.html,v 1.1 2005/05/25 12:37:18 tudor Exp $
00023 
00024 #ifndef _CSP_DECOMPOSITIONS_IDC_H
00025 #define _CSP_DECOMPOSITIONS_IDC_H
00026 
00027 
00028 CSP_NAMESPACE_BEGIN(csp);
00029 CSP_NAMESPACE_BEGIN(decompositions);
00030 
00031 
00032 #define IDC_DEFAULT_CHOICE_FACTOR 1.08
00033 
00034 
00052 class CSP_API IDC :
00053     public Decomposition
00054 {
00055   public:
00069     IDC(Problem& problem,
00070         Filter& filter,
00071         Retraction& retraction,
00072         Randomizer& randomizer,
00073         double choiceFactor = IDC_DEFAULT_CHOICE_FACTOR) :
00074         Decomposition(
00075             L"Inferred Disjunctive Constraints",
00076             L"IDC",
00077             problem,
00078             filter,
00079             retraction,
00080             randomizer),
00081         m_mcExtension(false),
00082         m_choiceFactor(choiceFactor) {}
00083 
00084   protected:
00096     IDC(const wstring& fullName,
00097         const wstring& shortName,
00098         Problem& problem,
00099         Filter& filter,
00100         Retraction& retraction,
00101         Randomizer& randomizer,
00102         double choiceFactor = IDC_DEFAULT_CHOICE_FACTOR) :
00103         Decomposition(
00104             fullName,
00105             shortName,
00106             problem,
00107             filter,
00108             retraction,
00109             randomizer),
00110         m_mcExtension(false),
00111         m_choiceFactor(choiceFactor) {}
00112 
00114     bool m_mcExtension;
00115 
00117     double m_choiceFactor;
00118 
00119   private:
00121     IDC(const IDC&);
00122 
00124     IDC& operator=(const IDC&);
00125 
00126     /*
00127      * Given a subproblem, we need to  compute its `size', defined as the
00128      * product of the size of the domain of each of its variables.  It is
00129      * assumed that no variable has an empty domain.
00130      */
00131     long double subproblemSize(const vlist_type& vlist);
00132 
00133     /*
00134      * Compute the size of the consistent subproblem, i.e.  the one
00135      * that has the selected value removed from `variable' and all the
00136      * values inconsistent with it removed from the domains of the
00137      * other variables.  `variable' is supposed to be instantiated to
00138      * the value with which its neighbors are supposed to be
00139      * consistent with, while `remainderSize' contains the size of the
00140      * problem without those values removed.
00141      */
00142     long double diffSize(Variable& variable, long double remainderSize);
00143 
00144     virtual void decompose();
00145 };
00146 
00147 
00148 CSP_NAMESPACE_END(decompositions);
00149 CSP_NAMESPACE_END(csp);
00150 
00151 
00152 #endif // _CSP_DECOMPOSITIONS_IDC_H
00153 
00154 // Local Variables:
00155 // mode: C++
00156 // End:

Generated on Wed May 25 12:21:14 2005 for csp.kdevelop by  doxygen 1.3.9.1