10 #ifndef EMP_LINEAR_CODE_H 11 #define EMP_LINEAR_CODE_H 13 #include "../base/array.h" 14 #include "../base/vector.h" 19 template <
size_t ARG_COUNT,
typename ARG_TYPE=
size_t>
38 if (
id == other.
id)
return args < other.
args;
43 void Set(
size_t _id,
const args_t & in_args) {
id = _id; args = in_args; }
53 template <
size_t ARG_COUNT=3,
typename ARG_TYPE=
size_t>
bool operator<(const Instruction &other) const
Test if this instruction is less than another.
Definition: LinearCode.h:37
Definition: LinearCode.h:54
Instruction(size_t _id=0, const args_t &in_args={})
Definition: LinearCode.h:26
Instruction & operator=(const Instruction &)=default
Copy operator.
void Set(size_t _id, const args_t &in_args)
Explicitly set the instruction type and specific arguments for this instruction.
Definition: LinearCode.h:43
args_t args
A set of arguments defining the specific behavior of this instruction.
Definition: LinearCode.h:24
void AddInst(size_t id, const emp::array< ARG_TYPE, ARG_COUNT > &in_args={})
Definition: LinearCode.h:56
size_t id
Unique value identifying which instruction this is.
Definition: LinearCode.h:23
bool operator==(const Instruction &in) const
Test if this instruction is identical to another.
Definition: LinearCode.h:46
If we are in emscripten, make sure to include the header.
Definition: array.h:37
A single instruction in a linear genome.
Definition: LinearCode.h:20
Build a debug wrapper emp::vector around std::vector.
Definition: vector.h:42