forked from Ramblurr/scriptbots
-
Notifications
You must be signed in to change notification settings - Fork 44
/
Agent.h
88 lines (64 loc) · 2.32 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#ifndef AGENT_H
#define AGENT_H
#include "DWRAONBrain.h"
#include "AssemblyBrain.h"
#include "MLPBrain.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;
bool spiked;
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?
float temperature_preference; //what temperature does this agent like? [0 to 1]
float smellmod;
float soundmod;
float hearmod;
float eyesensmod;
float bloodmod;
std::vector<float> eyefov; //field of view for each eye
std::vector<float> eyedir; //direction of each eye
// DWRAONBrain brain; //THE BRAIN!!!!
// AssemblyBrain brain;
MLPBrain 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