-
Notifications
You must be signed in to change notification settings - Fork 57
/
Agent.h
71 lines (51 loc) · 1.88 KB
/
Agent.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#ifndef AGENT_H
#define AGENT_H
#include "DWRAONBrain.h"
#include "vmath.h"
#include <vector>
#include <string>
class Agent
{
public:
Agent();
void printSelf();
//for drawing purposes
void initEvent(float size, float r, float g, float b);
void tick();
Agent reproduce(float MR, float MR2);
Agent crossover(const Agent &other);
Vector2f pos;
float health; //in [0,2]. I cant remember why.
float angle; //of the bot
float red;
float gre;
float blu;
float w1; //wheel speeds
float w2;
bool boost; //is this agent boosting
float spikeLength;
int age;
std::vector<float> in; //input: 2 eyes, sensors for R,G,B,proximity each, then Sound, Smell, Health
std::vector<float> out; //output: Left, Right, R, G, B, SPIKE
float repcounter; //when repcounter gets to 0, this bot reproduces
int gencount; //generation counter
bool hybrid; //is this agent result of crossover?
float clockf1, clockf2; //the frequencies of the two clocks of this bot
float soundmul; //sound multiplier of this bot. It can scream, or be very sneaky. This is actually always set to output 8
//variables for drawing purposes
float indicator;
float ir;float ig;float ib; //indicator colors
int selectflag; //is this agent selected?
float dfood; //what is change in health of this agent due to giving/receiving?
float give; //is this agent attempting to give food to other agent?
int id;
//inhereted stuff
float herbivore; //is this agent a herbivore? between 0 and 1
float MUTRATE1; //how often do mutations occur?
float MUTRATE2; //how significant are they?
DWRAONBrain brain; //THE BRAIN!!!!
//will store the mutations that this agent has from its parent
//can be used to tune the mutation rate
std::vector<std::string> mutations;
};
#endif // AGENT_H