aGrUM  0.20.2
a C++ library for (probabilistic) graphical models
treeOperatorStrategy.h
Go to the documentation of this file.
1 /**
2  *
3  * Copyright 2005-2020 Pierre-Henri WUILLEMIN(@LIP6) & Christophe GONZALES(@AMU)
4  * info_at_agrum_dot_org
5  *
6  * This library is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this library. If not, see <http://www.gnu.org/licenses/>.
18  *
19  */
20 
21 
22 /**
23  * @file
24  * @brief Headers of the TreeOperatorStrategy planer class.
25  *
26  * @author Jean-Christophe MAGNAN
27  */
28 
29 // =========================================================================
30 #ifndef GUM_TreeOperatorStrategy_H
31 #define GUM_TreeOperatorStrategy_H
32 // =========================================================================
33 #include <agrum/FMDP/planning/IOperatorStrategy.h>
34 // =========================================================================
35 
36 namespace gum {
37 
38  /**
39  * @class TreeOperatorStrategy treeOperatorStrategy.h
40  * <agrum/FMDP/planning/treeOperatorStrategy.h>
41  * @brief A class to find optimal policy for a given FMDP.
42  * @ingroup fmdp_group
43  *
44  * Perform a TreeOperatorStrategy planning on given in parameter factored
45  * markov decision process
46  *
47  */
48  template < typename GUM_SCALAR >
50  // ###################################################################
51  /// @name Constructor & destructor.
52  // ###################################################################
53  /// @{
54  public:
55  // ==========================================================================
56  /// Default constructor
57  // ==========================================================================
59 
60  // ==========================================================================
61  /// Default destructor
62  // ==========================================================================
64 
65  /// @}
66 
67 
68  // ###################################################################
69  /// @name
70  // ###################################################################
71  /// @{
72  public:
75  return MultiDimFunctionGraph< GUM_SCALAR >::getTreeInstance();
76  }
81  }
86  }
87 
88  /// @}
89 
90  // ###################################################################
91  /// @name Graph Function Operations Methods
92  // ###################################################################
93  /// @{
94 
95  protected:
96  // ==========================================================================
97  /// Computes Qaction for given actionid
98  /// @return qAction : the computed Q(s,a)
99  // ==========================================================================
102  Idx actionId,
103  const FMDP< GUM_SCALAR >* fmdp,
104  const Set< const DiscreteVariable* >& elVarSeq);
105 
106  // ==========================================================================
107  /// @warning given vFunction and qAction are deleted, returns the new one
108  // ==========================================================================
112  Idx del = 3);
113 
114  // ==========================================================================
115  /// @warning Minimze the two given functions
116  // ==========================================================================
120  Idx del = 3);
121 
122  // ==========================================================================
123  /// @warning given f1 and f2 are deleted, returns the new one
124  // ==========================================================================
128  Idx del = 3);
129 
130  // ==========================================================================
131  /// @warning given vFunction and qAction are deleted, returns the new one
132  // ==========================================================================
139  Idx del = 3);
140 
141  // ==========================================================================
142  /// @warning given function is deleted, returns the new one
143  // ==========================================================================
147  Idx del = 1);
148 
149  // ==========================================================================
150  /// @warning this time, nothing is deleted
151  // ==========================================================================
155  Idx del = 0);
156 
157 
158  /// @}
159  };
160 } /* namespace gum */
161 
162 
163 #include <agrum/FMDP/planning/treeOperatorStrategy_tpl.h>
164 
165 #endif // GUM_TreeOperatorStrategy_H
virtual MultiDimFunctionGraph< GUM_SCALAR > * minimize(const MultiDimFunctionGraph< GUM_SCALAR > *f1, const MultiDimFunctionGraph< GUM_SCALAR > *f2, Idx del=3)
~TreeOperatorStrategy()
Default destructor.
virtual MultiDimFunctionGraph< GUM_SCALAR > * add(const MultiDimFunctionGraph< GUM_SCALAR > *f1, const MultiDimFunctionGraph< GUM_SCALAR > *f2, Idx del=1)
Adds reward to given function( whether a f2 or f1)
INLINE void emplace(Args &&... args)
Definition: set_tpl.h:669
virtual MultiDimFunctionGraph< ArgMaxSet< GUM_SCALAR, Idx >, SetTerminalNodePolicy > * argmaximize(const MultiDimFunctionGraph< ArgMaxSet< GUM_SCALAR, Idx >, SetTerminalNodePolicy > *f1, const MultiDimFunctionGraph< ArgMaxSet< GUM_SCALAR, Idx >, SetTerminalNodePolicy > *f2, Idx del=3)
ArgMaximizes between f2 and f1.
virtual MultiDimFunctionGraph< GUM_SCALAR > * multiply(const MultiDimFunctionGraph< GUM_SCALAR > *f1, const MultiDimFunctionGraph< GUM_SCALAR > *f2, Idx del=3)
TreeOperatorStrategy()
Default constructor.
virtual MultiDimFunctionGraph< GUM_SCALAR > * subtract(const MultiDimFunctionGraph< GUM_SCALAR > *f1, const MultiDimFunctionGraph< GUM_SCALAR > *f2, Idx del=0)
Subtract current f1 from old f1 to see if threshold is reached or not.
virtual MultiDimFunctionGraph< GUM_SCALAR > * maximize(const MultiDimFunctionGraph< GUM_SCALAR > *f1, const MultiDimFunctionGraph< GUM_SCALAR > *f2, Idx del=3)
MultiDimFunctionGraph< GUM_SCALAR, ExactTerminalNodePolicy > * getFunctionInstance()