#ifndef _GLOBAL_HPP_
#define _GLOBAL_HPP_

#include "DataBase.h"
#include "View.h"

namespace global {

using namespace cluster;
using namespace numeric;
using namespace database;

struct Initialisation
{
	virtual cluster::View & operator() ( cluster::View & view ) const=0;
};

struct RandInit: public Initialisation
{
	cluster::View & operator() ( cluster::View & view ) const;
};

struct Algorithmus
{
	virtual cluster::View & operator() ( cluster::View & view ) const=0;
};


class Global
{
	private:
		const DataBase * dataBase;
		database::DataEngine * engine;
		cluster::View * view;
		cluster::Cluster * clusters;
		unsigned K;
		Global() {}

	public:
		Global( const database::DataBase & _dataBase,
		        unsigned K,
		        unsigned index=0,
		        unsigned history=10);

		double init( const Initialisation & initialisation = RandInit() );

		double run( const Algorithmus & vns);
};

}

#endif

