/*Header file of the PStep_PricingProblemSolver class

Implementation can be found in PStep_PricingProblemSolver.cpp

This class represents a function for solving pricing problems.

This file also includes derived classes of PStep_PricingProblemSolver.

*/

#ifndef _PSTEP_PRICINGPROBLEMSOLVER_H
#define _PSTEP_PRICINGPROBLEMSOLVER_H

#include "PStep_ShortestPathAlgorithm.h"
#include "clock.h"

//Class used to represent a function for solving pricing problems.
class PStep_PricingProblemSolver{
public:

	//Solve
	//------------------------------------------------------------------------------------

	//Solve pricing problems
	virtual void Solve(std::forward_list<PStep_ShortestPathAlgorithm*>& Algorithms) = 0;

};

//Class used to solve all pricing problems sequentially.
class PStep_AllPricingProblemSequentialSolver : public PStep_PricingProblemSolver{
public:

	//Solve
	//------------------------------------------------------------------------------------

	//Solve all pricing problems sequentially
	virtual void Solve(std::forward_list<PStep_ShortestPathAlgorithm*>& Algorithms);

};

//Class used to solve all pricing problems sequentially, and also store a potential savings in 
//pricing time by full paralleisation.
class PStep_AllPricingProblemSequentialSolverSavingsTimer : public PStep_AllPricingProblemSequentialSolver{
public:

	//Total potential savings
	//It is initialized as 0, and after every Solve, the total computation time minus the maximum computation time
	//is added.
	double TotalPotentialTimeSavings;

	//Constructr functions:
	//------------------------------------------------------------------------------------
	PStep_AllPricingProblemSequentialSolverSavingsTimer()
		: TotalPotentialTimeSavings(0)
	{};

	//Solve
	//------------------------------------------------------------------------------------

	//Solve all pricing problems sequentially, and also store a potential savings in 
	//pricing time by full paralleisation.
	virtual void Solve(std::forward_list<PStep_ShortestPathAlgorithm*>& Algorithms);

};

//Class used to solve all pricing problems in parallel.
class PStep_AllPricingProblemParallelSolver : public PStep_PricingProblemSolver{
public:

	//Solve
	//------------------------------------------------------------------------------------

	//Solve all pricing problems in parallel
	virtual void Solve(std::forward_list<PStep_ShortestPathAlgorithm*>& Algorithms);

};


#endif