You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
875 B

#pragma once
#include <vector>
#include "agent.h"
#include <QDebug>
#define RADUIS 10
#define BLIND_ANGLE M_PI/3
class Enviroment
{
private:
double lenth;
double width;
std::vector<Agent *> *multi_agent;
std::vector<std::vector<int>> adjacency_matrix;
std::vector<AgentState> coordinat_matrix;
public:
Enviroment(std::vector<Agent *> *, double, double);
~Enviroment(void);
void Observe(void);
void ObserveFromData(std::vector<AgentState>);
bool isRight(Agent*, Agent*);
bool isLeft(Agent*, Agent*);
int LeftRightDirection(Agent*, Agent*);
bool isInBlindAngle(Agent*, Agent*);
bool isInSenseRaduis(Agent*, Agent*);
AgentState GetRelativeCoordinate(Agent*, Agent*);
std::vector<std::vector<int>> GetAdjMat();
std::vector<AgentState> GetCoorMat();
std::vector<Point> GetTargets();
void RunOnce();
};