/*Header file of the PStep_BranchPriceAndCutStatistics class

Implementation can be found in PStep_BranchPriceAndCutStatistics.cpp

This class will contain the statistics of the execution of TDTWATree::BranchPriceAndCut.
It also contains the found solution.

*/

#ifndef _PStep_BranchPriceAndCutStatistics_H
#define _PStep_BranchPriceAndCutStatistics_H

#include "PStep_Solution.h" //Includes list, iostream and fstream
#include "PStep_SingleBPCIterationStatistics.h"

//Class used to represent the statistics of the execution of TDTWATree::BranchAndPrice.
class PStep_BranchPriceAndCutStatistics{
public:
	//Termination Flag
	//0: Minimum Optimality Gap attained
	//1: Problem infeasible
	//2: Time limit exceeded
	short int Flag;

	//Statistics per iteration
	std::list<PStep_SingleBPCIterationStatistics> IterationStatistics;

	//Solution, only used if the optimality gap is attained (Flag=0)
	PStep_Solution Solution;

	//Time of finding Solution
	double TimeSolutionFound;

	//Number of constructed branching nodes
	int NumberOfConstructedNodes;

	//Number of processed nodes
	int NumberOfProcessedNodes;

	//Number of times most fractional edge branching is called
	int NumberOfMostFractionalEdgeBranching;

	//Number of times Lysgaard branching is called
	int NumberOfLysgaardBranching;

	//Time:
	//Total computation time
	double TotalTime;

	//p-steps:
	//Number of p-steps at the start
	int NumberOfPStepsStart;

	//Number of p-steps at termination
	int NumberOfPStepsEnd;

	//Valid inequalities:

	//Number of capacity cuts at the start
	int NumberOfCCStart;

	//Number of capacity cuts at termination
	int NumberOfCCEnd;

	//Number of 2 edge hypotour cuts at the start
	int NumberOf2EHStart;

	//Number of 2 edge hypotour cuts at termination
	int NumberOf2EHEnd;

	//Number of strengthened comb cuts at the start
	int NumberOfSCombStart;

	//Number of strengthened comb cuts at termination
	int NumberOfSCombEnd;

	//Number of framed capacity cuts at the start
	int NumberOfFCCStart;

	//Number of framed capacity cuts at termination
	int NumberOfFCCEnd;

	//Number of homogeneous multistar cuts at the start
	int NumberOfHMCStart;

	//Number of homogeneous multistar cuts at termination
	int NumberOfHMCEnd;

	//Rootnode:
	//LP Value (Rootnode before adding valid inequalities) and LP Time
	double LPValue;
	double LPTime;
	//Rootnode Value (Rootnode after adding valid inequalities) and Rootnode Time
	double RootNodeValue;
	double RootNodeTime;

	//Constructor functions:
	//------------------------------------------------------------------------------------

	//Default Constructor
	PStep_BranchPriceAndCutStatistics();

	//Copy Constructor
	PStep_BranchPriceAndCutStatistics(const PStep_BranchPriceAndCutStatistics &OriginalPStep_BranchPriceAndCutStatistics);

	//Operator functions:
	//------------------------------------------------------------------------------------

	//Assignment operator
	PStep_BranchPriceAndCutStatistics operator=(const PStep_BranchPriceAndCutStatistics &OriginalPStep_BranchPriceAndCutStatistics);

	//Destructor functions
	//------------------------------------------------------------------------------------

	//Default destructor
	~PStep_BranchPriceAndCutStatistics();

	//Other functions
	//------------------------------------------------------------------------------------

	//Function to write the statistics to file. The format can be deduced from the implementation.
	void Write(const char* FileName);

	//Auxiliary functions
	//------------------------------------------------------------------------------------

	//Empty all entries
	void EmptyStatistics();

	//Copy all entries
	//IMPORTANT: it is assumed that the current statistics are empty!
	void CopyEmptyAssumed(const PStep_BranchPriceAndCutStatistics &OriginalPStep_BranchPriceAndCutStatistics);

};

#endif
