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_FILTERS_AC1_H
00025 #define _CSP_FILTERS_AC1_H
00026
00027
00028 CSP_NAMESPACE_BEGIN(csp);
00029 CSP_NAMESPACE_BEGIN(filters);
00030
00031
00035 class CSP_API AC1 :
00036 public Filter
00037 {
00038 public:
00039 AC1(Problem& problem, Retraction& retraction) :
00040 Filter(L"Arc Consistency 1", L"AC-1", problem, retraction) {}
00041 ~AC1() {}
00042
00043 virtual bool init(
00044 const vlist_type& uninstantiatedVariables,
00045 bool propagate = true);
00046 virtual void done() { Filter::done(); }
00047
00048 virtual bool restoresArcConsistency() const { return true; }
00049
00050 virtual bool propagate(
00051 const vlist_type& uninstantiatedVariables,
00052 const vlist_type& modifiedVariables,
00053 const bool keepChanges = true);
00054
00055 private:
00057 AC1(const AC1&);
00058
00060 AC1& operator=(const AC1&);
00061
00069 bool prune(Constraint& constraint, Variable& variable);
00070
00077 bool pruneVariablesInList(const vlist_type& vl);
00078
00080 Domain m_diffs;
00081
00083 bool m_changed;
00084 };
00085
00086
00087 CSP_NAMESPACE_END(filters);
00088 CSP_NAMESPACE_END(csp);
00089
00090
00091 #endif // _CSP_FILTERS_AC1_H
00092
00093
00094
00095