Empirical
|
#include <EventDrivenGP.h>
Public Types | |
using | program_t = emp::vector< Function > |
Public Member Functions | |
Program (Ptr< const inst_lib_t > _ilib, const program_t &_prgm=program_t()) | |
Program (const Program &)=default | |
void | Clear () |
Function & | operator[] (size_t id) |
const Function & | operator[] (size_t id) const |
bool | operator== (const Program &in) const |
bool | operator!= (const Program &in) const |
bool | operator< (const Program &other) const |
size_t | GetSize () const |
Get number of functions that make up this program. More... | |
size_t | GetInstCnt () const |
Get the total number of instructions across all functions that make up this program. More... | |
Ptr< const inst_lib_t > | GetInstLib () const |
bool | ValidPosition (size_t fID, size_t pos) const |
bool | ValidFunction (size_t fID) const |
void | SetProgram (const program_t &_program) |
void | PushFunction (const Function &_function) |
void | PushFunction (const affinity_t &_aff=affinity_t(), const inst_seq_t &_seq=inst_seq_t()) |
void | PushInst (size_t id, arg_t a0=0, arg_t a1=0, arg_t a2=0, const affinity_t &aff=affinity_t(), int fID=-1) |
void | PushInst (const std::string &name, arg_t a0=0, arg_t a1=0, arg_t a2=0, const affinity_t &aff=affinity_t(), int fID=-1) |
void | PushInst (const inst_t &inst, int fID=-1) |
void | SetInst (size_t fID, size_t pos, size_t id, arg_t a0=0, arg_t a1=0, arg_t a2=0, const affinity_t &aff=affinity_t()) |
void | SetInst (size_t fID, size_t pos, const inst_t &inst) |
void | Load (std::istream &input) |
void | PrintInst (const inst_t &inst, std::ostream &os=std::cout) |
Print out a single instruction with its arguments. More... | |
void | PrintInstFull (const inst_t &inst, std::ostream &os=std::cout) |
Fully print out a single instruction with its arguments/affinity. More... | |
void | PrintProgram (std::ostream &os=std::cout) |
Print out entire program. More... | |
void | PrintProgramFull (std::ostream &os=std::cout) |
Print out entire program. More... | |
Public Attributes | |
Ptr< const inst_lib_t > | inst_lib |
program_t | program |
Program struct. Defines an EventDrivenGP program. A programs consists of a set of functions where each function is a named sequence of instructions. Function names are bit strings (stored as a BitSet). Programs require an associated instruction library to give meaning to the instructions that make up their functions.
using emp::EventDrivenGP_AW< AFFINITY_WIDTH >::Program::program_t = emp::vector<Function> |
|
inline |
|
default |
|
inline |
|
inline |
Get the total number of instructions across all functions that make up this program.
|
inline |
|
inline |
Get number of functions that make up this program.
|
inline |
Load entire program from input stream. Warning: This function accepts a slightly different than what the Program's PrintProgram function prints out (for now, will add a PrintProgram variant that prints in this load function's accepted format). Program format: Fn-AFFINITY: INST_NAMEAFFINITY ... Fn-AFFINITY: ...
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Print out a single instruction with its arguments.
|
inline |
Fully print out a single instruction with its arguments/affinity.
|
inline |
Print out entire program.
|
inline |
Print out entire program.
|
inline |
|
inline |
|
inline |
Push new instruction to program. If no function pointer is provided and no functions exist yet, add new function to program and push to that. If no function pointer is provided and functions exist, push to last function in program. If function pointer is provided, push to that function.
|
inline |
Push new instruction to program. If no function pointer is provided and no functions exist yet, add new function to program and push to that. If no function pointer is provided and functions exist, push to last function in program. If function pointer is provided, push to that function.
|
inline |
Push new instruction to program. If no function pointer is provided and no functions exist yet, add new function to program and push to that. If no function pointer is provided and functions exist, push to last function in program. If function pointer is provided, push to that function.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Ptr<const inst_lib_t> emp::EventDrivenGP_AW< AFFINITY_WIDTH >::Program::inst_lib |
program_t emp::EventDrivenGP_AW< AFFINITY_WIDTH >::Program::program |