29 #ifndef GUM_RANDOM_VARIABLE_TYPE_H 30 #define GUM_RANDOM_VARIABLE_TYPE_H 35 #include <agrum/agrum.h> 37 #include <agrum/tools/multidim/implementations/multiDimArray.h> 38 #include <agrum/tools/multidim/implementations/multiDimImplementation.h> 39 #include <agrum/tools/variables/discreteVariable.h> 40 #include <agrum/tools/variables/labelizedVariable.h> 42 #include <agrum/PRM/elements/PRMObject.h> 43 #include <agrum/PRM/utils_prm.h> 48 template <
typename GUM_SCALAR >
62 class PRMType:
public PRMObject {
69 template <
typename GUM_SCALAR >
70 friend class PRMFactory;
79 static PRMType* boolean() {
80 LabelizedVariable var(
"boolean",
"Boolean variable", 0);
81 var.addLabel(
"false");
83 return new PRMType(var);
96 explicit PRMType(
const DiscreteVariable& var);
103 PRMType(PRMType& super_type,
104 const std::vector< Idx >& label_map,
105 const DiscreteVariable& var);
111 PRMType(
const PRMType& from);
125 DiscreteVariable& variable();
128 const DiscreteVariable& variable()
const;
139 DiscreteVariable& operator*();
144 const DiscreteVariable& operator*()
const;
149 DiscreteVariable* operator->();
154 DiscreteVariable
const* operator->()
const;
159 bool operator==(
const PRMObject& from)
const;
164 bool operator!=(
const PRMObject& from)
const;
175 virtual prm_type obj_type()
const;
180 const std::string& name()
const;
185 bool isSubType()
const;
192 bool isSubTypeOf(
const PRMType& super)
const;
197 bool isSuperTypeOf(
const PRMType& t)
const;
203 PRMType& superType();
209 const PRMType& superType()
const;
228 void setSuper(PRMType& t);
235 const std::vector< Idx >& label_map()
const;
249 PRMType(PRMType&& from);
254 PRMType& operator=(
const PRMType& from);
259 PRMType& operator=(PRMType&& from);
268 bool _isValid_()
const;
275 DiscreteVariable* _var_;
278 PRMType* _superType_;
282 std::vector< Idx >* _label_map_;
291 #ifndef GUM_NO_INLINE 292 # include <agrum/PRM/elements/PRMType_inl.h>