aGrUM  0.14.2
structuralConstraintTabuList.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005 by Christophe GONZALES and Pierre-Henri WUILLEMIN *
3  * {prenom.nom}_at_lip6.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
34 #ifndef GUM_LEARNING_STRUCTURAL_CONSTRAINT_TABU_LIST_H
35 #define GUM_LEARNING_STRUCTURAL_CONSTRAINT_TABU_LIST_H
36 
37 #include <limits>
38 
39 #include <agrum/agrum.h>
40 #include <agrum/core/bijection.h>
43 
44 #define GUM_STRUCTURAL_CONSTRAINT_TABU_LIST_DEFAULT_SIZE 2
45 
46 namespace gum {
47 
48  namespace learning {
49 
67  public:
68  // ##########################################################################
70  // ##########################################################################
72 
75 
78 
81 
84 
87 
89 
90  // ##########################################################################
92  // ##########################################################################
94 
98 
101 
103 
104  // ##########################################################################
106  // ##########################################################################
108 
110  void setTabuListSize(Size new_size);
111 
113  void setGraphAlone(const DiGraph& graph);
114 
116 
120  void modifyGraphAlone(const ArcAddition& change);
121 
123 
125  void modifyGraphAlone(const ArcDeletion& change);
126 
128 
132  void modifyGraphAlone(const ArcReversal& change);
133 
135 
139  void modifyGraphAlone(const GraphChange& change);
140 
142 
155  bool isAlwaysInvalidAlone(const GraphChange& change) const;
156 
158 
160  bool checkArcAdditionAlone(NodeId x, NodeId y) const;
161 
163 
164  bool checkArcDeletionAlone(NodeId x, NodeId y) const;
165 
167 
169  bool checkArcReversalAlone(NodeId x, NodeId y) const;
170 
172 
177  bool checkModificationAlone(const GraphChange& change) const;
178 
180 
182  bool checkModificationAlone(const ArcAddition& change) const;
183 
185 
186  bool checkModificationAlone(const ArcDeletion& change) const;
187 
189 
191  bool checkModificationAlone(const ArcReversal& change) const;
192 
194 
195 #ifndef DOXYGEN_SHOULD_SKIP_THIS
196 // include the set of methods that enable the structural constraint to
197 // be standalone, i.e., that it needs not be included into a
198 // StructuralConstraintSetStatic to be used by learning algorithms
199 # define GUM_CONSTRAINT_CLASS_NAME StructuralConstraintTabuList
201 # undef GUM_CONSTRAINT_CLASS_NAME
202 #endif // DOXYGEN_SHOULD_SKIP_THIS
203 
204  protected:
207 
210  };
211 
212  } /* namespace learning */
213 
214 } /* namespace gum */
215 
217 #ifndef GUM_NO_INLINE
219 #endif /* GUM_NO_INLINE */
220 
221 #endif /* GUM_LEARNING_STRUCTURAL_TABU_LIST_H */
the classes to account for structure changes in a graph
The class for notifying learning algorithms of new arc additionsThis class is convenient to know at c...
Definition: graphChange.h:147
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:213
bool checkModificationAlone(const GraphChange &change) const
checks whether the constraints enable to perform a graph change
the base class for all structural constraints
gum is the global namespace for all aGrUM entities
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
the base class for all structural constraints
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:108
Set of pairs of elements with fast search for both elements.
Definition: bijection.h:1803
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:279
The class imposing a N-sized tabu list as a structural constraints for learning algorithms.
the class imposing a N-sized tabu list as a structural constraints for learning algorithms ...
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition: types.h:45
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:97
Set of pairs of elements with fast search for both elements.