#ifndef H_DATASTRUCTURE
#define H_DATASTRUCTURE

#include <iostream>
#include "Globals.h"
//*************************
//
//Created by Clauda Ephrem		Date Jan 3, 2008
//
//
//
//*************************

using namespace std;
class Agent;
struct IndexEntry
{
	int Previous;
	Agent * pAgent;
	int Next;
	IndexEntry()
	{
		Previous = -1;
		pAgent =NULL;
		Next=-1;
	}
};


class AgentIndex
{
public:
int LastTouched;
int FirstVacant;
IndexEntry* IndexBody;
void Swap(int a, int b);

void MoveBefore (int a, int b);

public:
	AgentIndex(int population);
	Agent* GetLastTouched();
	Agent* GetRandomAgent();
	void Remove (int AgentLocation);
	void Insert (Agent* NewAgent);
	void getAgentsInfo (ofstream& outfile);
	
};

#endif;