/**
*	\file IKEPsolver.h
*	\brief	Class representing a vertex.
*	\author	Matteo Petris
*	\date	April 2021
*/

#ifndef KEPSOLVER_H
#define KEPSOLVER_H
#pragma once
#include "Header.h"
#include "Instance.h"
#include "Exchange.h"
#include "RestrictedMasterProblem.h"
#include "CyclesInitializer.h"
#include "ChainsInitializer.h"
#include "PricingProblem.h"
#include"ExactGeneratorCyclesChains.h"
#include "ColumnGeneration.h"
#include "ColumnGenerationMediator.h"
#include "ArcBranch.h"
#include "VisitBranch.h"
#include "ExchangeNumberBranch.h"
#include "BestFirstStrategy.h"
#include "BranchAndPrice.h"
#include "SubsetRowInequalities.h"
#include "SubsetRowPadberg.h"
#include "OddHolePadberg.h"
#include "CliqueInequalities.h"
#include "SolutionStats.h"

/**
*	\class IKEPsolver.
*	\brief	Class implementing the solving procedure for the IKEP
*/
class KEPsolver {

protected:

	Instance* instance;					/**< instance KEP*/
	string fileName;
	string IKEPname;

	double value;
	double bound;
	double time;
	vector<Exchange> solution;
	string length_stats;
	string csv_line;

public:

	//CONSTRUCTORS (default, parametrized, copy)
	KEPsolver();
	KEPsolver(Instance* instanceKEP, const string& fileName, const string& IKEPname);
	KEPsolver(const KEPsolver& s);

	//DESTRUCTOR
	~KEPsolver();

	//OPERATORS OVERLOADING (assignment, equality, not equal to)
	KEPsolver& operator=(const KEPsolver& s);
	friend bool operator==(const KEPsolver& s1, const KEPsolver& s2);
	friend bool operator!=(const KEPsolver& s1, const KEPsolver& s2);

	//METHODS
	void solve(const bool& arePathsPriced, const bool& areCyclesPriced, const double& time_limit);

	//GET METHODS
	const double& getValue() const;
	const double& getBound() const;
	const double& getTime() const;
	const vector<Exchange>& getSolution() const;
	const string& get_length_stats() const;
	const string& get_csv_line() const;

	//SET METHODS
	

	/**
	*	\brief	Converts the vertex into a string containing information related to it.
	*	Useful to have the vertex in an output like a text file or console.
	*	\return converted_vertex : string
	*/
	const string toString() const;

};

#endif //KEPSOLVER_H