#ifndef __RESEAU_H
#define __RESEAU_H
#include <iostream>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <vector>
#include <string>
#include <fstream>
#include "couche.h"
#include "inputCouche.h"
#include "hiddenCouche.h"
#include "outputCouche.h"
#include "../InterfaceCpp/shmdata.h"

#include "Utils.h"
#include "global.h"

class Reseau 
	{
	private:
		struct shmdata *SData;
		int shmid;
		Utils util;
	public:
		InputCouche Icouche;
		HiddenCouche Hcouche;
		OutputCouche Ocouche;
		Reseau();
		Reseau(int In, int Hid, int Out);
		void rebuild(int In, int Hid, int Out);
		~Reseau();
	//	void initshm();
		std::vector<double> forward(bool input[]);
		void backward(bool input[], bool target[]);	/*  */
		double getError(bool target[]);
		double learnOne(bool input[], bool target[]);	/*  */
		double learnAll(std::vector<bool *> inputs, std::vector<bool *> targets);
		void saveState(const char* filename) throw(std::string);
		void loadState(const char* filename) throw(std::string);
		Reseau& operator=(const Reseau& c);
	};

#endif

