3 #include <boost/serialization/vector.hpp> 21 template <
typename Archive>
55 int get_action(
const std::vector<unsigned char>& screen);
56 template <
typename Archive>
64 bool execute_block(
const std::vector<unsigned char>& screen,
int block);
66 inline double sigmoid(
double x)
const;
auto end_outputs()
Definition: agent.cpp:114
parameters(int input_size, int output_size, int nb_registers, int block_size, int nb_blocks)
Definition: agent.hpp:15
void mutate(agent &a)
Definition: agent.cpp:304
void initialize(agent &a)
Definition: agent.cpp:296
double sigmoid(double x) const
Definition: agent.cpp:18
void execute_instruction(const std::vector< unsigned char > &screen, int pc)
Definition: agent.cpp:35
int input_size
Definition: agent.hpp:9
int nb_blocks
Definition: agent.hpp:13
Definition: agent.cpp:244
void print_instruction(std::ostream &, instruction ins) const
Definition: agent.cpp:155
void serialize(Archive &ar, const unsigned int)
Definition: agent.hpp:22
std::string reg_to_string(int reg) const
Definition: agent.cpp:144
opcode
Definition: agent.hpp:31
int get_action(const std::vector< unsigned char > &screen)
Definition: agent.cpp:119
int block_size
Definition: agent.hpp:12
int output_size
Definition: agent.hpp:10
bool execute_block(const std::vector< unsigned char > &screen, int block)
Definition: agent.cpp:23
std::ostream & operator<<(std::ostream &, const agent &)
Definition: agent.cpp:234
void serialize(Archive &ar, const unsigned int)
Definition: agent.hpp:57
auto begin_outputs()
Definition: agent.cpp:109
std::vector< reg > registers
Definition: agent.hpp:52
parameters params
Definition: agent.hpp:50
int nb_registers
Definition: agent.hpp:11
void reset_registers()
Definition: agent.cpp:13
void crossover(agent &a1, agent &a2)
Definition: agent.cpp:317
void print_block(std::ostream &, int block) const
Definition: agent.cpp:223
uint64_t instruction
Definition: agent.hpp:48
double reg
Definition: agent.hpp:49
std::vector< instruction > program
Definition: agent.hpp:51