From 35e76eac52d5fbb370ddb92810d7daf4ea684beb Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Fri, 1 Dec 2023 16:12:57 +0100 Subject: core: Experimental changes to tree and mcts --- c++/core/mcts.h | 15 +++++++++++++++ c++/core/tree.h | 7 ++++--- 2 files changed, 19 insertions(+), 3 deletions(-) (limited to 'c++') 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 +struct mcts_value { + State state; +}; +template +class mcts_tree { +private: + /** + * @todo + * Basically I need to a tree with tree> + */ +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> children_; + using branch = std::variant>; + std::vector children_; public: /** * Default constructor @@ -101,14 +102,14 @@ public: /** * Returns the branch at i */ - branch& at(std::size_t i){ + branch& at(std::size_t i){ return children_.at(i); } /** * Returns the branch at i */ - const branch& at(std::size_t i) const { + const branch& at(std::size_t i) const { return children_.at(i); } }; -- cgit v1.2.3