aGrUM  0.16.0
structuralConstraintTabuList.h
Go to the documentation of this file.
1 
37 #ifndef GUM_LEARNING_STRUCTURAL_CONSTRAINT_TABU_LIST_H
38 #define GUM_LEARNING_STRUCTURAL_CONSTRAINT_TABU_LIST_H
39 
40 #include <limits>
41 
42 #include <agrum/agrum.h>
43 #include <agrum/core/bijection.h>
46 
47 #define GUM_STRUCTURAL_CONSTRAINT_TABU_LIST_DEFAULT_SIZE 2
48 
49 namespace gum {
50 
51  namespace learning {
52 
70  public:
71  // ##########################################################################
73  // ##########################################################################
75 
78 
81 
84 
87 
90 
92 
93  // ##########################################################################
95  // ##########################################################################
97 
101 
104 
106 
107  // ##########################################################################
109  // ##########################################################################
111 
113  void setTabuListSize(Size new_size);
114 
116  void setGraphAlone(const DiGraph& graph);
117 
119 
123  void modifyGraphAlone(const ArcAddition& change);
124 
126 
128  void modifyGraphAlone(const ArcDeletion& change);
129 
131 
135  void modifyGraphAlone(const ArcReversal& change);
136 
138 
142  void modifyGraphAlone(const GraphChange& change);
143 
145 
158  bool isAlwaysInvalidAlone(const GraphChange& change) const;
159 
161 
163  bool checkArcAdditionAlone(NodeId x, NodeId y) const;
164 
166 
167  bool checkArcDeletionAlone(NodeId x, NodeId y) const;
168 
170 
172  bool checkArcReversalAlone(NodeId x, NodeId y) const;
173 
175 
180  bool checkModificationAlone(const GraphChange& change) const;
181 
183 
185  bool checkModificationAlone(const ArcAddition& change) const;
186 
188 
189  bool checkModificationAlone(const ArcDeletion& change) const;
190 
192 
194  bool checkModificationAlone(const ArcReversal& change) const;
195 
197 
198 #ifndef DOXYGEN_SHOULD_SKIP_THIS
199 // include the set of methods that enable the structural constraint to
200 // be standalone, i.e., that it needs not be included into a
201 // StructuralConstraintSetStatic to be used by learning algorithms
202 # define GUM_CONSTRAINT_CLASS_NAME StructuralConstraintTabuList
204 # undef GUM_CONSTRAINT_CLASS_NAME
205 #endif // DOXYGEN_SHOULD_SKIP_THIS
206 
207  protected:
210 
213  };
214 
215  } /* namespace learning */
216 
217 } /* namespace gum */
218 
220 #ifndef GUM_NO_INLINE
222 #endif /* GUM_NO_INLINE */
223 
224 #endif /* GUM_LEARNING_STRUCTURAL_TABU_LIST_H */
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
The class for notifying learning algorithms of new arc additionsThis class is convenient to know at c...
Definition: graphChange.h:150
void setTabuListSize(Size new_size)
sets the size of the tabu list
The class for notifying learning algorithms of arc removalsThis class is convenient to know at compil...
Definition: graphChange.h:216
bool checkModificationAlone(const GraphChange &change) const
checks whether the constraints enable to perform a graph change
the base class for all structural constraints
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
NodeId _TabuList__offset
the index of the oldest element
void setGraphAlone(const DiGraph &graph)
sets a new graph from which we will perform checkings
bool checkArcReversalAlone(NodeId x, NodeId y) const
checks whether the constraints enable to reverse arc (x,y)
StructuralConstraintTabuList & operator=(const StructuralConstraintTabuList &from)
copy operator
void modifyGraphAlone(const ArcAddition &change)
notify the constraint of a modification of the graph
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
bool checkArcDeletionAlone(NodeId x, NodeId y) const
checks whether the constraints enable to remove arc (x,y)
Base class for all oriented graphs.
Definition: diGraph.h:111
Set of pairs of elements with fast search for both elements.
Definition: bijection.h:1805
Bijection< GraphChange, NodeId > _TabuList__changes
the tabu list
bool isAlwaysInvalidAlone(const GraphChange &change) const
indicates whether a change will always violate the constraint
The class for notifying learning algorithms of arc reversalsThis class is convenient to know at compi...
Definition: graphChange.h:282
The class imposing a N-sized tabu list as a structural constraints for learning algorithms.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition: types.h:48
bool checkArcAdditionAlone(NodeId x, NodeId y) const
checks whether the constraints enable to add arc (x,y)
Size NodeId
Type for node ids.
Definition: graphElements.h:98
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.