28 #ifndef GUM_ACTION_SET_H 29 #define GUM_ACTION_SET_H 54 template <
typename GUM_SCALAR >
61 const GUM_SCALAR&
operator()(
const GUM_SCALAR& x,
const GUM_SCALAR& y)
const {
62 if (x > y) {
return x; }
63 if (x < y) {
return y; }
104 __actionSeq->
insert(*idi);
110 __actionSeq->
insert(*idi);
125 void*
operator new(
size_t s) {
128 void operator delete(
void* p) {
143 return __actionSeq->beginSafe();
162 __actionSeq->insert(elem);
171 if (!__actionSeq->exists(*iter)) __actionSeq->insert(*iter);
180 if (__actionSeq->exists(*iter)) __actionSeq->erase(*iter);
194 if (!__actionSeq->exists(*iter))
return false;
195 for (
auto iter = this->beginSafe(); iter != this->endSafe(); ++iter)
196 if (!compared.
exists(*iter))
return false;
200 return !(*
this == compared);
210 bool exists(
const Idx& elem)
const {
return __actionSeq->exists(elem); }
222 #endif // GUM_ACTION_SET_H
const GUM_SCALAR & operator()(const GUM_SCALAR &x, const GUM_SCALAR &y) const
Headers of the ITerminalNodePolicy.
bool operator==(const ActionSet &compared) const
Compares two ActionSet to check if they are equals.
Size size() const
Gives the size.
Headers of gum::SmallObjectAllocator.
A class to store the optimal actions.
aGrUM's inline/outline selection
ActionSet(const ActionSet &src)
Constructor.
friend std::ostream & operator<<(std::ostream &streamy, const ActionSet &objy)
std::string toString() const
Displays the content of the sequence.
gum is the global namespace for all aGrUM entities
This files contains several function objects that are not (yet) defined in the STL.
bool exists(const Idx &elem) const
SequenceIteratorSafe< Idx > endSafe() const
Iterator end.
Sequence< Idx > * __actionSeq
The very bone of the ActionSet.
ActionSet & operator=(const ActionSet &src)
Constructor.
Class for implementation of factored markov decision process.
ActionSet & operator+=(const ActionSet &src)
Use to insert the content of another set inside this one.
ActionSet & operator-=(const ActionSet &src)
Use to insert the content of another set inside this one.
Headers of MultiDimFunctionGraph.
SequenceIteratorSafe< Idx > beginSafe() const
Iterator beginning.
ActionSet & operator+=(const Idx &elem)
Ajout d'un élément.
void deallocate(void *pDeallocatedObject, const size_t &objectSize)
Deallocates an object.
bool operator!=(const ActionSet &compared) const
Ajout d'un élément.
const Idx & operator[](const Idx i) const
Gives the ith element.
This files contains several function objects that are not (yet) defined in the STL.
Size Idx
Type for indexes.
void * allocate(const size_t &objectSize)
Allocates a block.
static SmallObjectAllocator & instance()
std::size_t Size
In aGrUM, hashed values are unsigned long int.
<agrum/FMDP/planning/actionSet.h>
void insert(const Key &k)
Insert an element at the end of the sequence.