Fleet  0.0.9
Inference in the LOT
Searchable.h
Go to the documentation of this file.
1 #pragma once
2 
3 
12 template<typename this_t, typename... Args>
13 class Searchable {
14 public:
15 
20  [[nodiscard]] virtual int neighbors() const = 0; // how many neighbors do I have?
21 
26  virtual void expand_to_neighbor(int k) = 0; // modifies this hypothesis rather than making a new one
27 
28 
35  [[nodiscard]] virtual this_t make_neighbor(int k) const {
36  this_t out = *static_cast<this_t*>(const_cast<Searchable<this_t,Args...>*>(this));
37  out.expand_to_neighbor(k);
38  return out;
39  }
40 
45  virtual double neighbor_prior(int k) = 0; // what is the prior of this neighbor?
46 
47 
52  virtual void complete() = 0;
53 
58  [[nodiscard]] virtual bool is_evaluable() const = 0;
59 
60 };
virtual void complete()=0
Fill in all the holes in this hypothesis, at random, modifying self. NOTE for LOTHypotheses this will...
virtual double neighbor_prior(int k)=0
What is the prior of the k&#39;th neighbor? This does not need to return the full prior, only relative (among ks)
virtual bool is_evaluable() const =0
Check if we can evaluate this node (meaning compute a prior and posterior). NOTE that this is not the...
virtual int neighbors() const =0
Count the number of neighbors that are possible. (This should be size_t but int is more convenient...
Definition: Searchable.h:13
virtual this_t make_neighbor(int k) const
Return a new hypothesis which is the k&#39;th neighbor (just calls expand_to_neighbor) NOTE This does not...
Definition: Searchable.h:35
virtual void expand_to_neighbor(int k)=0
Modify this hypothesis to become the k&#39;th neighbor. NOTE This does not compile since it might not be ...