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

LC.h

00001 // LC.h -- The LC (Local Changes) decomposition algorithm interface.
00002 
00003 /*
00004  * Copyright (C) 2003 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: LC_8h-source.html,v 1.1 2005/05/25 12:37:18 tudor Exp $
00023 
00024 #ifndef _CSP_DECOMPOSITIONS_LC_H
00025 #define _CSP_DECOMPOSITIONS_LC_H
00026 
00027 
00028 CSP_NAMESPACE_BEGIN(csp);
00029 CSP_NAMESPACE_BEGIN(decompositions);
00030 
00031 
00037 class CSP_API LC :
00038     public Decomposition
00039 {
00040   public:
00049     LC(Problem& problem,
00050        Filter& filter,
00051        Retraction& retraction,
00052        Randomizer& randomizer);
00053 
00055     ~LC();
00056 
00057   protected:
00068     LC(const wstring& fullName,
00069        const wstring& shortName,
00070        Problem& problem,
00071        Filter& filter,
00072        Retraction& retraction,
00073        Randomizer& randomizer) :
00074         Decomposition(
00075             fullName,
00076             shortName,
00077             problem,
00078             filter,
00079             retraction,
00080             randomizer),
00081         m_mcExtension(false) {}
00082 
00084     bool m_mcExtension;
00085 
00086   private:
00088     LC(const LC&);
00089 
00091     LC& operator=(const LC&);
00092 
00094     virtual bool init();
00095 
00101     virtual void decompose();
00102 
00109     void addUncertainVariable(Variable& variable);
00110 
00124     void assignUncertainVariables(int depth);
00125 
00133     void unassignUncertainVariables(int depth);
00134 
00143     void getConsistentUncertainVariables(
00144         Variable& variable,
00145         vlist_type& consistentUncertainVariables);
00146 
00157     bool propagateWithUncertainVariables(Variable& variable);
00158 
00170     bool propagateWithInstantiatedVariables(Variable& variable);
00171 
00180     void selectUncertainVariables();
00181 
00190     bool searchSubProblem(Variable& variable);
00191 
00203     bool mcPropagation(Variable& variable, Domain& failed);
00204 
00216     int decomposeVariable(Variable& variable);
00217 
00231     bool decomposeValue(Variable& variable);
00232 
00234     vector<vlist_type> m_uncertainVariables;
00235 
00240     typedef hash_map<Variable*, Value*> vv_type;
00241 
00243     vv_type m_uncertainValues;
00244 };
00245 
00246 
00247 CSP_NAMESPACE_END(decompositions);
00248 CSP_NAMESPACE_END(csp);
00249 
00250 
00251 #endif // _CSP_DECOMPOSITIONS_LC_H
00252 
00253 // Local Variables:
00254 // mode: C++
00255 // End:

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