Empirical
|
#include <EventDrivenGP.h>
Public Member Functions | |
State (mem_val_t _default_mem_val=0.0, bool _is_main=false) | |
State (const State &)=default | |
State (State &&)=default | |
void | Reset () |
Reset state object. More... | |
size_t | GetFP () const |
Get function pointer. More... | |
size_t | GetIP () const |
Get instruction pointer. More... | |
mem_val_t | GetDefaultMemValue () const |
Get default memory value. More... | |
void | SetIP (size_t ip) |
Set instruction pointer to given value, ip. More... | |
void | SetFP (size_t fp) |
Set function pointer to given value, fp. More... | |
void | SetDefaultMemValue (mem_val_t val) |
Set default memory value to given value, val. More... | |
void | AdvanceIP (size_t inc=1) |
Advance instruction pointer by amount given by inc. More... | |
bool | IsMain () const |
Is this a main state? More... | |
memory_t & | GetLocalMemory () |
Get a reference to the local memory map for this state. More... | |
memory_t & | GetInputMemory () |
Get a reference to the input memory map for this state. More... | |
memory_t & | GetOutputMemory () |
Get a reference to the output memory map for this state. More... | |
mem_val_t | GetLocal (mem_key_t key) const |
mem_val_t | GetInput (mem_key_t key) const |
mem_val_t | GetOutput (mem_key_t key) const |
void | SetLocal (mem_key_t key, mem_val_t value) |
Set local memory specified by key to value. More... | |
void | SetInput (mem_key_t key, mem_val_t value) |
Set input memory specified by key to value. More... | |
void | SetOutput (mem_key_t key, mem_val_t value) |
Set output memory specified by key to value. More... | |
mem_val_t & | AccessLocal (mem_key_t key) |
mem_val_t & | AccessInput (mem_key_t key) |
mem_val_t & | AccessOutput (mem_key_t key) |
Public Attributes | |
memory_t | local_mem |
memory_t | input_mem |
memory_t | output_mem |
double | default_mem_val |
size_t | func_ptr |
size_t | inst_ptr |
emp::vector< Block > | block_stack |
bool | is_main |
Struct to maintain local program state for a given function call. A local program state has an associated: local memory map, input memory map, output memory map, function pointer, instruction pointer, and block stack.
|
inline |
|
default |
|
default |
|
inline |
Access input memory. This function returns a reference to memory location value if that location exists. If the location does not exist, set to default memory value and return reference to memory location value.
|
inline |
Access local memory. This function returns a reference to memory location value if that location exists. If the location does not exist, set to default memory value and return reference to memory location value.
|
inline |
Access output memory. This function returns a reference to memory location value if that location exists. If the location does not exist, set to default memory value and return reference to memory location value.
|
inline |
Advance instruction pointer by amount given by inc.
|
inline |
Get default memory value.
|
inline |
Get function pointer.
|
inline |
Get value at requested input memory location (key) if that memory location exists. Otherwise, return default memory value.
|
inline |
Get a reference to the input memory map for this state.
|
inline |
Get instruction pointer.
|
inline |
Get value at requested local memory location (key) if that memory location exists. Otherwise, return default memory value.
|
inline |
Get a reference to the local memory map for this state.
|
inline |
Get value at requested output memory location (key) if that memory location exists. Otherwise, return default memory value.
|
inline |
Get a reference to the output memory map for this state.
|
inline |
Is this a main state?
|
inline |
Reset state object.
|
inline |
Set default memory value to given value, val.
|
inline |
Set function pointer to given value, fp.
|
inline |
Set input memory specified by key to value.
|
inline |
Set instruction pointer to given value, ip.
|
inline |
Set local memory specified by key to value.
|
inline |
Set output memory specified by key to value.
emp::vector<Block> emp::EventDrivenGP_AW< AFFINITY_WIDTH >::State::block_stack |
double emp::EventDrivenGP_AW< AFFINITY_WIDTH >::State::default_mem_val |
size_t emp::EventDrivenGP_AW< AFFINITY_WIDTH >::State::func_ptr |
memory_t emp::EventDrivenGP_AW< AFFINITY_WIDTH >::State::input_mem |
size_t emp::EventDrivenGP_AW< AFFINITY_WIDTH >::State::inst_ptr |
bool emp::EventDrivenGP_AW< AFFINITY_WIDTH >::State::is_main |
memory_t emp::EventDrivenGP_AW< AFFINITY_WIDTH >::State::local_mem |
memory_t emp::EventDrivenGP_AW< AFFINITY_WIDTH >::State::output_mem |