aGrUM  0.14.2
structuralConstraintSliceOrder.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  ***************************************************************************/
36 #ifndef GUM_LEARNING_STRUCTURAL_CONSTRAINT_SLICE_ORDER_H
37 #define GUM_LEARNING_STRUCTURAL_CONSTRAINT_SLICE_ORDER_H
38 
39 #include <agrum/agrum.h>
42 
43 namespace gum {
44 
45  namespace learning {
46 
65  : protected virtual StructuralConstraintSetStatic<
66  StructuralConstraintDiGraph > {
67  public:
68  // ##########################################################################
70  // ##########################################################################
72 
75 
77 
79 
82  const NodeProperty< NodeId >& order);
83 
86 
89 
92 
94 
95  // ##########################################################################
97  // ##########################################################################
99 
103 
107 
109 
110  // ##########################################################################
112  // ##########################################################################
114 
116  void setSliceOrder(const NodeProperty< NodeId >& slice);
117 
119  const NodeProperty< NodeId >& sliceOrder() const;
120 
122  void addNode(NodeId node, NodeId slice);
123 
126  void setDefaultSlice(NodeId slice);
127 
129  void setGraphAlone(const DiGraph& graph);
130 
132 
138  void modifyGraphAlone(const ArcAddition& change);
139 
141 
143  void modifyGraphAlone(const ArcDeletion& change);
144 
146 
152  void modifyGraphAlone(const ArcReversal& change);
153 
155 
161  void modifyGraphAlone(const GraphChange& change);
162 
164 
177  bool isAlwaysInvalidAlone(const GraphChange& change) const;
178 
180 
183  bool checkArcAdditionAlone(NodeId x, NodeId y) const;
184 
186 
187  bool checkArcDeletionAlone(NodeId x, NodeId y) const;
188 
190 
192  bool checkArcReversalAlone(NodeId x, NodeId y) const;
193 
195 
198  bool checkModificationAlone(const ArcAddition& change) const;
199 
201 
202  bool checkModificationAlone(const ArcDeletion& change) const;
203 
205 
207  bool checkModificationAlone(const ArcReversal& change) const;
208 
210 
216  bool checkModificationAlone(const GraphChange& change) const;
217 
219 
220 #ifndef DOXYGEN_SHOULD_SKIP_THIS
221 // include the set of methods that enable the structural constraint to
222 // be standalone, i.e., that it needs not be included into a
223 // StructuralConstraintSetStatic to be used by learning algorithms
224 # define GUM_CONSTRAINT_CLASS_NAME StructuralConstraintSliceOrder
226 # undef GUM_CONSTRAINT_CLASS_NAME
227 #endif // DOXYGEN_SHOULD_SKIP_THIS
228 
229  protected:
232  };
233 
234  } /* namespace learning */
235 
236 } /* namespace gum */
237 
239 #ifndef GUM_NO_INLINE
241 #endif /* GUM_NO_INLINE */
242 
243 #endif /* GUM_LEARNING_STRUCTURAL_CONSTRAINT_SLICE_ORDER_H */
bool checkArcAdditionAlone(NodeId x, NodeId y) const
checks whether the constraints enable to add arc (x,y)
bool checkArcReversalAlone(NodeId x, NodeId y) const
checks whether the constraints enable to reverse arc (x,y)
bool checkArcDeletionAlone(NodeId x, NodeId y) const
checks whether the constraints enable to remove arc (x,y)
The class for notifying learning algorithms of new arc additionsThis class is convenient to know at c...
Definition: graphChange.h:147
void setGraphAlone(const DiGraph &graph)
sets a new graph from which we will perform checkings
void setDefaultSlice(NodeId slice)
assign a given slice to all the nodes specified in the partial order
The class for notifying learning algorithms of arc removalsThis class is convenient to know at compil...
Definition: graphChange.h:213
StructuralConstraintSliceOrder & operator=(const StructuralConstraintSliceOrder &from)
copy operator
NodeProperty< NodeId > _SliceOrder__order
slices to which belong the nodes
the "meta-programming" class for storing several structural constraints
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
The class for generic Hash Tables.
Definition: hashTable.h:676
bool checkModificationAlone(const ArcAddition &change) const
checks whether the constraints enable to add an arc
void setSliceOrder(const NodeProperty< NodeId > &slice)
sets the time slices of all the nodes in the property
const NodeProperty< NodeId > & sliceOrder() const
returns the current slice order
the base class for structural constraints used by learning algorithms that learn a directed graph str...
the "meta-programming" class for storing structural constraintsIn aGrUM, there are two ways to store ...
Base class for all oriented graphs.
Definition: diGraph.h:108
bool isAlwaysInvalidAlone(const GraphChange &change) const
indicates whether a change will always violate the constraint
void modifyGraphAlone(const ArcAddition &change)
notify the constraint of a modification of the graph
The class for notifying learning algorithms of arc reversalsThis class is convenient to know at compi...
Definition: graphChange.h:279
the structural constraint imposing a partial order over nodes
Size NodeId
Type for node ids.
Definition: graphElements.h:97
void addNode(NodeId node, NodeId slice)
adds a new node in the slice order
the structural constraint imposing a partial order over nodes