This might be an easy question, but I cannot figure out why the compiler it's giving me this error. I have two classes. Agent and Environment. WHen I try to add an object of type Agent in my Environment class I get Agent does not name to a type error. I am including Agent.h in my Environment.h class
#ifndef AGENT_H_INCLUDED
#define AGENT_H_INCLUDED
#include <vector>
#include <iostream>
#include "Environment.h"
using namespace std;
class Agent{
public:
Agent(bool s);
vector<int> getPercept();
void setPercept(vector<int> p);
void goForward();
void turnRight();
void turnLeft();
void clean();
void paint();
void refuel();
bool needsRefuel();
void turnOn();
void turnOff();
bool isActive();
void move();
int getCurX();
int getCurY();
char getCurDir();
void setCurrentPosition(int x, int y, char d);
private:
vector<int> percept;
int actions;
int performance;
char direction;
bool isOn;
int curX;
int curY;
char curDir;
};
#endif // AGENT_H_INCLUDED
/*************************/
#ifndef ENVIRONMENT_H_INCLUDED
#define ENVIRONMENT_H_INCLUDED
#include <vector>
#include <iostream>
#include "Agent.h"
using namespace std;
class Environment{
public:
Environment(vector<vector<char> > roomData);
Environment(vector<vector<char> > roomData, vector<int> status);
void setRoomData(vector<vector<char> > roomData);
bool isSimulationComplete();
void isAgentHome();
vector<int> sendLocationStatus();
void printEnvironment();
void setAgentHome(int x, int y);
vector<int> getAgentPercept();
void setAgentPercept(vector<int> status);
void setAgentPosition(int x, int y, char p);
vector<int> sendAgentPercept();
void calculateAgentPercept();
private:
vector<vector<char> > room;
vector<int> agentPercept;
bool simulationComplete;
int agentHomeX;
int agentHomeY;
int agentX;
int agentY;
char agentDir;
Agent agent; ////ERROR IS HERE
};
#endif // ENVIRONMENT_H_INCLUDED