-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVesselMng.h
More file actions
47 lines (45 loc) · 1.09 KB
/
Copy pathVesselMng.h
File metadata and controls
47 lines (45 loc) · 1.09 KB
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
#pragma once
#include "rtNEAT.h"
#include <BWAPI.h>
enum command
{
NOCOMMMAND=0,
CONTINUE,
HOLD,
ATTACK,
MOVE
};
class VesselMng
{
protected:
double *inputs,*outputs;
NEAT::Organism *organism;
NEAT::Network *brain;
command act;
command lastCommand;
double fitness;
int KillCount,DeathCount,pastKC;
int timeAlive;
public:
VesselMng();
// Translates the game state into a double array
// in order for the network to be able to handle
virtual void generateInputs()=0;
//Loads inputs to network and Translates it into commands
virtual void generateOutputs()=0;
//virtual bool loadSensors(NEAT::Network *net)=0;
// Generic function to issue commands
virtual void issueCommands()=0;
virtual double assessFitness()=0;
virtual double groupProximity()=0;
virtual bool isDead()=0;
double getNormFitness();
bool attachBrain(NEAT::Network *net);
bool changeOrganism(NEAT::Organism *newOrgan);
NEAT::Organism* getOrganism();
NEAT::Network* getBrain();
virtual double getK2Dratio()=0;
void resetFitness();
double makeInBound(double out);
double getAngle(int x1, int y1, int x2, int y2);
};