#ifndef __STATE__ACTION_H
#define __STATE__ACTION_H

////////////////////////////////////////////////////////////
//class CStateValue:

class CStateValue //: public CObject
{
	
//DECLARE_SERIAL(CStateValue)
public:
	double m_value;
	int	   m_nTimesVisited;
//	void   Serialize( CArchive& archive );
	CStateValue():m_nTimesVisited(0),m_value(0){}
//	CStateValue& operator=(const CStateValue& other);
};

////////////////////////////////////////////////////////////
//class CStateAction interface:
//
//This class implements the Q(s,a) objects of the target function 

/*class CStateAction
{
public:

	//State parameters
	int    m_nJunctionConfig;
	int	   m_NumOfCarsArray[NUM_OF_LANES];	
	int    m_nHour;
	int    m_nNextConfig; //action taken
	
	CStateAction(int conf = 0,int hour = 0, int nextConfig = 0);
	bool operator==(const CStateAction& stateAction) const;
	CStateAction(const CStateAction& stateAction);
	const CStateAction& operator=(const CStateAction& stateAction);

//	friend bool operator==(const CStateAction& leftState, const CStateAction& rightState) const;

};*/


class CStateAction
{
public:

	//State parameters
	int    m_nJunctionConfig;
	int    m_nNumOfCarsNorth;
	int    m_nNumOfCarsEast;
	int    m_nNumOfCarsSouth;
	int    m_nNumOfCarsWest;
	int    m_nHour;

	int    m_nNextConfig; //action taken
	CStateAction(int conf = 0, int carsNorth= 0 , int carsEast = 0,
		int carsSouth = 0, int carsWest = 0, int hour = 0, int nextConfig = 0):
		m_nJunctionConfig(conf),      //This is set to a start configuration.
		m_nNumOfCarsNorth(carsNorth),
		m_nNumOfCarsEast(carsEast),
		m_nNumOfCarsSouth(carsSouth),
		m_nNumOfCarsWest(carsWest),
		m_nHour(hour),
		m_nNextConfig(nextConfig)
	{}
	bool operator==(const CStateAction& stateAction) const;
    int GetLaneTraffic(int numOfCars);
	void NormalizeTrafficValues();
	//	friend bool operator==(const CStateAction& leftState, const CStateAction& rightState) const;

};


#endif