#include <VirtualMachinePool.h>
|
typedef VirtualMachineState_t::output_t | output_t |
|
typedef VirtualMachineState_t::input_t | input_t |
|
|
| VirtualMachinePool () |
|
virtual | ~VirtualMachinePool () |
|
virtual void | clear () |
| Remove everything and reset my values. More...
|
|
bool | wouldIadd (double lp) |
| Returns true if I would add something with this lp, given my MAX_STEPS and the stack. This lets us speed up by checking if we would add before copying/constructing a VMS. More...
|
|
void | push (VirtualMachineState_t *o) |
| Add the VirtualMachineState_t o to this pool (but again checking if I'd add) More...
|
|
template<typename T > |
bool | copy_increment_push (const VirtualMachineState_t *x, T v, double lpinc) |
| This is an important opimization where we will make a copy of x, push v into it's stack, and increment its lp by lpinc only if it will be added to the queue, which we check in the pool here. This saves us from having to use the VirtualMachineState constructor (e.g. making a copy, which is expensive if we are copying all the stacks) if the copy won't actually be added to the queue. More...
|
|
template<typename T > |
bool | increment_push (VirtualMachineState_t *s, T v, double lpinc) |
| Same as copy_increment_push, but does not make a copy – just add. More...
|
|
DiscreteDistribution< output_t > | run () |
| This runs and adds up the probability mass for everything, returning a dictionary outcomes->log_probabilities. This is the main running loop, which pops frmo the top of our queue, runs, and continues until we've done enough or all. Note that objects lower than min_lp are not ever pushed onto the queue. More...
|
|
std::vector< VirtualMachineState_t > | run_vms () |
| Run but return a vector of completed virtual machines instead of marginalizing outputs. You might want this if you needed to separate execution paths, or wanted to access runtime counts. This also can get joint distributions on outputs by running a VirtualMachineState multiple times. More...
|
|
template<typename VirtualMachineState_t>
class VirtualMachinePool< VirtualMachineState_t >
- Author
- piantado
- Date
- 02/02/20
◆ input_t
template<typename VirtualMachineState_t>
◆ output_t
template<typename VirtualMachineState_t>
◆ VirtualMachinePool()
template<typename VirtualMachineState_t>
◆ ~VirtualMachinePool()
template<typename VirtualMachineState_t>
◆ clear()
template<typename VirtualMachineState_t>
Remove everything and reset my values.
◆ copy_increment_push()
template<typename VirtualMachineState_t>
template<typename T >
bool VirtualMachinePool< VirtualMachineState_t >::copy_increment_push |
( |
const VirtualMachineState_t * |
x, |
|
|
T |
v, |
|
|
double |
lpinc |
|
) |
| |
|
inline |
This is an important opimization where we will make a copy of x, push v into it's stack, and increment its lp by lpinc only if it will be added to the queue, which we check in the pool here. This saves us from having to use the VirtualMachineState constructor (e.g. making a copy, which is expensive if we are copying all the stacks) if the copy won't actually be added to the queue.
- Parameters
-
- Returns
◆ increment_push()
template<typename VirtualMachineState_t>
template<typename T >
bool VirtualMachinePool< VirtualMachineState_t >::increment_push |
( |
VirtualMachineState_t * |
s, |
|
|
T |
v, |
|
|
double |
lpinc |
|
) |
| |
|
inline |
Same as copy_increment_push, but does not make a copy – just add.
- Parameters
-
- Returns
◆ push()
template<typename VirtualMachineState_t>
Add the VirtualMachineState_t o to this pool (but again checking if I'd add)
- Parameters
-
◆ run()
template<typename VirtualMachineState_t>
This runs and adds up the probability mass for everything, returning a dictionary outcomes->log_probabilities. This is the main running loop, which pops frmo the top of our queue, runs, and continues until we've done enough or all. Note that objects lower than min_lp are not ever pushed onto the queue.
- Parameters
-
- Returns
HMM Do we want to count these too? I guess since its called "total"....
◆ run_vms()
template<typename VirtualMachineState_t>
std::vector<VirtualMachineState_t> VirtualMachinePool< VirtualMachineState_t >::run_vms |
( |
| ) |
|
|
inline |
Run but return a vector of completed virtual machines instead of marginalizing outputs. You might want this if you needed to separate execution paths, or wanted to access runtime counts. This also can get joint distributions on outputs by running a VirtualMachineState multiple times.
- Parameters
-
- Returns
◆ wouldIadd()
template<typename VirtualMachineState_t>
Returns true if I would add something with this lp, given my MAX_STEPS and the stack. This lets us speed up by checking if we would add before copying/constructing a VMS.
- Parameters
-
- Returns
template<typename VirtualMachineState_t>
std::priority_queue<VirtualMachineState_t*, std::vector<VirtualMachineState_t*>, VirtualMachinePool::compare_VirtualMachineState_t_prt> VirtualMachinePool< VirtualMachineState_t >::Q |
◆ total_instruction_count
template<typename VirtualMachineState_t>
◆ total_vms_steps
template<typename VirtualMachineState_t>
◆ worst_lp
template<typename VirtualMachineState_t>
The documentation for this class was generated from the following file: