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_AC8_H
00025 #define _CSP_FILTERS_AC8_H
00026
00027
00028 CSP_NAMESPACE_BEGIN(csp);
00029 CSP_NAMESPACE_BEGIN(filters);
00030
00031
00038 class CSP_API AC8 :
00039 public Filter
00040 {
00041 public:
00042 AC8(Problem& problem, Retraction& retraction) :
00043 Filter(L"Arc Consistency 8", L"AC-8", problem, retraction) {}
00044 ~AC8() {}
00045
00046 virtual bool init(
00047 const vlist_type& uninstantiatedVariables,
00048 bool propagate = true);
00049 virtual void done() { Filter::done(); }
00050
00051 virtual bool restoresArcConsistency() const { return true; }
00052
00053 virtual bool propagate(
00054 const vlist_type& uninstantiatedVariables,
00055 const vlist_type& modifiedVariables,
00056 const bool keepChanges = true);
00057
00058 private:
00060 AC8(const AC8&);
00061
00063 AC8& operator=(const AC8&);
00064
00070 void insertInQueue(Variable& variable);
00071
00077 void removeFromQueue(Variable& variable);
00078
00085 bool isInQueue(const Variable& variable);
00086
00088 Domain m_diffs;
00089
00091 deque<Variable*> m_queue;
00092
00094 hash_set<const Variable*> m_inQueue;
00095 };
00096
00097
00098 CSP_NAMESPACE_END(filters);
00099 CSP_NAMESPACE_END(csp);
00100
00101
00102 #endif // _CSP_FILTERS_AC8_H
00103
00104
00105
00106