Fleet  0.0.9
Inference in the LOT
Public Member Functions | List of all members
MyMCTS Class Reference

#include <MyMCTS.h>

Inheritance diagram for MyMCTS:
Inheritance graph
[legend]
Collaboration diagram for MyMCTS:
Collaboration graph
[legend]

Public Member Functions

 MyMCTS (MyMCTS &&)
 
virtual generator< MyHypothesis & > playout (MyHypothesis &current) override
 This gets called on a child that is unvisited. Typically it would consist of filling in h some number of times and saving the stats. More...
 
- Public Member Functions inherited from MCTSBase< MyMCTS, MyHypothesis >
 MCTSBase ()
 
 MCTSBase (MyHypothesis &start, MyMCTS *par, size_t w)
 
 MCTSBase (MyHypothesis &start, double ex, data_t *d)
 
 MCTSBase (const MyMCTS &m)
 
 MCTSBase (MyMCTS &&m)
 
void operator= (const MCTSBase &m)
 
void operator= (MCTSBase &&m)
 
void print (MyHypothesis from, std::ostream &o, const int depth, const bool sort)
 
void print (MyHypothesis &start, const bool sort=true)
 
void print (MyHypothesis &start, const char *filename, const bool sort=true)
 
void add_sample (const float v)
 
virtual generator< MyHypothesis &> run_thread (Control &ctl, MyHypothesis h0) override
 
virtual void process_evaluable (MyHypothesis &current)
 If we can evaluate this current node (usually: compute a posterior and add_sample) More...
 
virtual void add_children (MyHypothesis &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 (MyHypothesis &current)
 
virtual MyMCTSdescend_to_childless (MyHypothesis &current)
 This goes down the tree to a node with no children (OR evaluable) More...
 
virtual MyMCTSdescend_to_evaluable (MyHypothesis &current)
 This goes down the tree, sampling children until it finds an evaluable (building a full tree) More...
 
- Public Member Functions inherited from ThreadedInferenceInterface< MyHypothesis, MyHypothesis >
virtual generator< MyHypothesis &> 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< MyHypothesis &> run (Control ctl, Args... args)
 Set up the multiple threads and actually run, calling run_thread_generator_wrapper. More...
 
generator< MyHypothesis &> unthreaded_run (Control ctl, Args... args)
 
- Public Member Functions inherited from BaseNode< MyMCTS >
 BaseNode (size_t n=0, MyMCTS *p=nullptr, size_t i=0)
 Constructor of basenode – sizes children to n. More...
 
 BaseNode (const MyMCTS &n)
 
 BaseNode (MyMCTS &&n)
 
void operator= (const MyMCTS &t)
 
void operator= (const MyMCTS &&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 MyMCTS &n) const
 
NodeIterator begin () const
 
NodeIterator end () const
 
virtual bool operator!= (const MyMCTS &n) const
 
void reserve_children (const size_t n)
 
decltype(children) & get_children ()
 
decltype(children) const & get_children () const
 
MyMCTSchild (const size_t i)
 
const MyMCTSchild (const size_t i) const
 
void fill (size_t n, Args... args)
 
size_t nchildren () const
 
MyMCTSleft_descend () const
 
size_t depth () const
 
void fix_child_info ()
 
void check_child_info () const
 
MyMCTSoperator[] (const size_t i)
 
const MyMCTSoperator[] (const size_t i) const
 
void set_child (const size_t i, MyMCTS &n)
 
void set_child (const size_t i, MyMCTS &&n)
 
void push_back (MyMCTS &n)
 
void push_back (MyMCTS &&n)
 
virtual bool is_root () const
 Am I a root node? I am if my parent is nullptr. More...
 
MyMCTSroot ()
 Find the root of this node by walking up the tree. More...
 
MyMCTSget_via (std::function< bool(MyMCTS &)> &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 MyMCTS &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 MyMCTSget_nth (int n, std::function< int(const MyMCTS &)> &f)
 
virtual MyMCTSget_nth (int n)
 
sum (std::function< T(const MyMCTS &)> &f) const
 
sum (T(*f)(const MyMCTS &)) const
 
bool all (std::function< bool(const MyMCTS &)> &f) const
 
void map (const std::function< void(MyMCTS &)> &f)
 
void show (size_t t=0) const
 

Additional Inherited Members

- Public Types inherited from MCTSBase< MyMCTS, MyHypothesis >
using data_t = typename MyHypothesis ::data_t
 
- Public Attributes inherited from MCTSBase< MyMCTS, MyHypothesis >
bool open
 
SpinLock mylock
 
int which_expansion
 
std::atomic< unsigned int > nvisits
 
StreamingStatistics statistics
 
- Public Attributes inherited from ThreadedInferenceInterface< MyHypothesis, MyHypothesis >
std::atomic< size_t > index
 
size_t __nthreads
 
std::atomic< size_t > __nrunning
 
ConcurrentQueueRing< MyHypothesisto_yield
 
- Public Attributes inherited from BaseNode< MyMCTS >
MyMCTSparent
 
size_t pi
 
- Static Public Attributes inherited from MCTSBase< MyMCTS, MyHypothesis >
static double explore
 
static data_tdata
 
- Static Public Attributes inherited from BaseNode< MyMCTS >
static NodeIterator EndNodeIterator
 
- Protected Attributes inherited from BaseNode< MyMCTS >
std::vector< MyMCTSchildren
 

Constructor & Destructor Documentation

◆ MyMCTS()

MyMCTS::MyMCTS ( MyMCTS &&  )
inline

Member Function Documentation

◆ playout()

virtual generator<MyHypothesis&> MyMCTS::playout ( MyHypothesis current)
inlineoverridevirtual

This gets called on a child that is unvisited. Typically it would consist of filling in h some number of times and saving the stats.

Parameters
h

Reimplemented from PartialMCTSNode< MyMCTS, MyHypothesis >.


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