aGrUM  0.20.3
a C++ library for (probabilistic) graphical models
treeOperatorStrategy.h
Go to the documentation of this file.
1 /**
2  *
3  * Copyright (c) 2005-2021 by 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:
74  return MultiDimFunctionGraph< GUM_SCALAR >::getTreeInstance();
75  }
80  }
83  }
84 
85  /// @}
86 
87  // ###################################################################
88  /// @name Graph Function Operations Methods
89  // ###################################################################
90  /// @{
91 
92  protected:
93  // ==========================================================================
94  /// Computes Qaction for given actionid
95  /// @return qAction : the computed Q(s,a)
96  // ==========================================================================
98  Idx actionId,
99  const FMDP< GUM_SCALAR >* fmdp,
100  const Set< const DiscreteVariable* >& elVarSeq);
101 
102  // ==========================================================================
103  /// @warning given vFunction and qAction are deleted, returns the new one
104  // ==========================================================================
108  Idx del = 3);
109 
110  // ==========================================================================
111  /// @warning Minimze the two given functions
112  // ==========================================================================
116  Idx del = 3);
117 
118  // ==========================================================================
119  /// @warning given f1 and f2 are deleted, returns the new one
120  // ==========================================================================
124  Idx del = 3);
125 
126  // ==========================================================================
127  /// @warning given vFunction and qAction are deleted, returns the new one
128  // ==========================================================================
130  argmaximize(
133  Idx del = 3);
134 
135  // ==========================================================================
136  /// @warning given function is deleted, returns the new one
137  // ==========================================================================
140  Idx del = 1);
141 
142  // ==========================================================================
143  /// @warning this time, nothing is deleted
144  // ==========================================================================
148  Idx del = 0);
149 
150 
151  /// @}
152  };
153 } /* namespace gum */
154 
155 
156 #include <agrum/FMDP/planning/treeOperatorStrategy_tpl.h>
157 
158 #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:643
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()