Fleet  0.0.9
Inference in the LOT
List of all members
PartialMCTSNode< this_t, HYP > Class Template Reference

#include <PartialMCTSNode.h>

Inheritance diagram for PartialMCTSNode< this_t, HYP >:
Inheritance graph
[legend]
Collaboration diagram for PartialMCTSNode< this_t, HYP >:
Collaboration graph
[legend]

Additional Inherited Members

- Public Types inherited from MCTSBase< this_t, HYP >
using data_t = typename HYP::data_t
 
- Public Member Functions inherited from MCTSBase< this_t, HYP >
 MCTSBase ()
 
 MCTSBase (HYP &start, this_t *par, size_t w)
 
 MCTSBase (HYP &start, double ex, data_t *d)
 
 MCTSBase (const this_t &m)
 
 MCTSBase (this_t &&m)
 
void operator= (const MCTSBase &m)
 
void operator= (MCTSBase &&m)
 
void print (HYP from, std::ostream &o, const int depth, const bool sort)
 
void print (HYP &start, const bool sort=true)
 
void print (HYP &start, const char *filename, const bool sort=true)
 
void add_sample (const float v)
 
virtual generator< HYP & > run_thread (Control &ctl, HYP h0) override
 
virtual void process_evaluable (HYP &current)
 If we can evaluate this current node (usually: compute a posterior and add_sample) More...
 
virtual void add_children (HYP &current)
 This gets called before descending the tree if we don't have all of our children. NOTE: This could add all the children (default) or be overwritten to add one, or none. More...
 
virtual int sample_child_index (HYP &current)
 
virtual this_t * descend_to_childless (HYP &current)
 This goes down the tree to a node with no children (OR evaluable) More...
 
virtual this_t * descend_to_evaluable (HYP &current)
 This goes down the tree, sampling children until it finds an evaluable (building a full tree) More...
 
- Public Member Functions inherited from ThreadedInferenceInterface< HYP, HYP >
virtual generator< HYP &> run_thread (Control &ctl, Args... args)=0
 
 ThreadedInferenceInterface ()
 
unsigned long next_index ()
 Return the next index to operate on (in a thread-safe way). More...
 
size_t nthreads ()
 How many threads are currently run in this interface? More...
 
void run_thread_generator_wrapper (size_t thr, Control &ctl, Args... args)
 We have to wrap run_thread in something that manages the sync with main. This really just synchronizes the output of run_thread with run below. NOTE this makes a copy of x into the local next_x, so that when the thread keeps running, it doesn't mess anything up. We may in the future block the thread and return a reference, but its not clear that's faster. More...
 
generator< HYP &> run (Control ctl, Args... args)
 Set up the multiple threads and actually run, calling run_thread_generator_wrapper. More...
 
generator< HYP &> unthreaded_run (Control ctl, Args... args)
 
- Public Member Functions inherited from BaseNode< this_t >
 BaseNode (size_t n=0, this_t *p=nullptr, size_t i=0)
 Constructor of basenode – sizes children to n. More...
 
 BaseNode (const this_t &n)
 
 BaseNode (this_t &&n)
 
void operator= (const this_t &t)
 
void operator= (const this_t &&t)
 
void make_root ()
 Make a node root – just nulls the parent. More...
 
virtual ~BaseNode ()
 
virtual std::string string (bool usedot=true) const
 
virtual std::string my_string () const
 
virtual bool operator== (const this_t &n) const
 
NodeIterator begin () const
 
NodeIterator end () const
 
virtual bool operator!= (const this_t &n) const
 
void reserve_children (const size_t n)
 
decltype(children) & get_children ()
 
decltype(children) const & get_children () const
 
this_t & child (const size_t i)
 
const this_t & child (const size_t i) const
 
template<typename... Args>
void fill (size_t n, Args... args)
 
size_t nchildren () const
 
this_t * left_descend () const
 
size_t depth () const
 
void fix_child_info ()
 
void check_child_info () const
 
this_t & operator[] (const size_t i)
 
const this_t & operator[] (const size_t i) const
 
void set_child (const size_t i, this_t &n)
 
void set_child (const size_t i, this_t &&n)
 
void push_back (this_t &n)
 
void push_back (this_t &&n)
 
virtual bool is_root () const
 Am I a root node? I am if my parent is nullptr. More...
 
this_t * root ()
 Find the root of this node by walking up the tree. More...
 
this_t * get_via (std::function< bool(this_t &)> &f)
 Return a pointer to the first node satisfying predicate f, in standard traversal; nullptr otherwise. More...
 
virtual size_t count () const
 How many nodes total are below me? More...
 
virtual size_t count (const this_t &n) const
 How many nodes below me are equal to n? More...
 
virtual bool is_terminal () const
 Am I a terminal? I am if I have no children. More...
 
virtual size_t count_terminals () const
 
virtual this_t * get_nth (int n, std::function< int(const this_t &)> &f)
 
virtual this_t * get_nth (int n)
 
template<typename T >
sum (std::function< T(const this_t &)> &f) const
 
template<typename T >
sum (T(*f)(const this_t &)) const
 
bool all (std::function< bool(const this_t &)> &f) const
 
void map (const std::function< void(this_t &)> &f)
 
void show (size_t t=0) const
 
- Public Attributes inherited from MCTSBase< this_t, HYP >
bool open
 
SpinLock mylock
 
int which_expansion
 
std::atomic< unsigned int > nvisits
 
StreamingStatistics statistics
 
- Public Attributes inherited from ThreadedInferenceInterface< HYP, HYP >
std::atomic< size_t > index
 
size_t __nthreads
 
std::atomic< size_t > __nrunning
 
ConcurrentQueueRing< HYP > to_yield
 
- Public Attributes inherited from BaseNode< this_t >
this_t * parent
 
size_t pi
 
- Static Public Attributes inherited from MCTSBase< this_t, HYP >
static double explore = 1.0
 
static data_tdata = nullptr
 
- Static Public Attributes inherited from BaseNode< this_t >
static NodeIterator EndNodeIterator = NodeIterator(nullptr)
 
- Protected Attributes inherited from BaseNode< this_t >
std::vector< this_t > children
 

Detailed Description

template<typename this_t, typename HYP>
class PartialMCTSNode< this_t, HYP >

Author
piantado
Date
03/07/20

The documentation for this class was generated from the following file: