sweetApple 36 Newbie Poster

I am creating a program that involves a simple agent navigating a grid world to discover food. I am having trouble creating a unique class for the agent (which contains data members that represent its perception of the world - direction of the smell of the food, a visual 5x7 field which contains barracades and other world objects, and the agent's energy ). The agent receives these in the form of a single string from a socket buffer and then sends its response based on it's reasoning resulting from the current state of the environment (which changes every time it makes a decision- so it is a stimulus-response agent).

I am very new at programming (probably obviously) and would appreciate some code critique and/or ideas on how to make this program better. I am specifically having troubles with moving my existing implementation to an agent class in a .h file. I also would like to include the 2d vector representing the agent's visual field in that class and maybe add data members to it which represent front, back, left, right etc. Thank you for taking the time to look : )

/* agentnavigation
 */
 
using namespace std;

#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <string>
#include <vector>
#include <stack>
#include <iomanip>

#include "connection.cpp"
#include "agent.h"



int main( ) 
{
	string role;
	int sock;
	/* establishing role as base */
	role = "base\n";
	
	/* to connect to the environment of Maeden, connect to the Madenport server 
	by …
Ancient Dragon commented: Thanks for using code tags correctly the first time :) +36