diff options
-rw-r--r-- | c++/core/mcts.h | 15 | ||||
-rw-r--r-- | c++/core/tree.h | 7 |
2 files changed, 19 insertions, 3 deletions
diff --git a/c++/core/mcts.h b/c++/core/mcts.h index 30eed2f..f0f3ba5 100644 --- a/c++/core/mcts.h +++ b/c++/core/mcts.h @@ -1,5 +1,20 @@ #pragma once +#include "tree.h" + namespace saw { +template<typename State> +struct mcts_value { + State state; +}; +template<typename State> +class mcts_tree { +private: + /** + * @todo + * Basically I need to a tree with tree<mcts_value<State>> + */ +public: +}; } diff --git a/c++/core/tree.h b/c++/core/tree.h index 6316a5e..32572fc 100644 --- a/c++/core/tree.h +++ b/c++/core/tree.h @@ -25,7 +25,8 @@ private: /** * Object holding the treeed branch instances */ - std::vector<branch<T>> children_; + using branch = std::variant<T, tree<T>>; + std::vector<branch> children_; public: /** * Default constructor @@ -101,14 +102,14 @@ public: /** * Returns the branch at i */ - branch<T>& at(std::size_t i){ + branch& at(std::size_t i){ return children_.at(i); } /** * Returns the branch at i */ - const branch<T>& at(std::size_t i) const { + const branch& at(std::size_t i) const { return children_.at(i); } }; |