LinearCode.hpp

A linear sequence of instructions.

template<size_t ARG_COUNT, typename ARG_TYPE = size_t>
struct Instruction
#include <LinearCode.hpp>

A single instruction in a linear genome.

Public Types

using args_t = array<ARG_TYPE, ARG_COUNT>

Public Functions

inline Instruction(size_t _id = 0, const args_t &in_args = {})
Instruction(const Instruction&) = default
Instruction(Instruction&&) = default
Instruction &operator=(const Instruction&) = default

Copy operator.

Instruction &operator=(Instruction&&) = default

Move operator.

inline bool operator<(const Instruction &other) const

Test if this instruction is less than another.

inline void Set(size_t _id, const args_t &in_args)

Explicitly set the instruction type and specific arguments for this instruction.

inline bool operator==(const Instruction &in) const

Test if this instruction is identical to another.

Public Members

size_t id

Unique value identifying which instruction this is.

args_t args

A set of arguments defining the specific behavior of this instruction.

template<size_t ARG_COUNT = 3, typename ARG_TYPE = size_t>
class LinearCode : public vector<Instruction<3, size_t>>
#include <LinearCode.hpp>

Public Functions

inline void AddInst(size_t id, const array<ARG_TYPE, ARG_COUNT> &in_args = {})