00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
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
00254
00255