/*Header file of the PStep_ColumnGenerationStatistics class

Implementation can be found in PStep_ColumnGenerationStatistics.cpp

This class will contain the statistics of the execution of PStep_Tree::ColumnGeneration.

*/

#ifndef _PSTEP_COLUMNGENERATIONSTATISTICS_H
#define _PSTEP_COLUMNGENERATIONSTATISTICS_H

#include <list>
#include <iostream>
#include <fstream>
#include "PStep_SingleCGIterationStatistics.h"

//Class used to represent the statistics of the execution of PStep_Tree::ColumnGeneration.
class PStep_ColumnGenerationStatistics{
public:
	//Termination Flag
	//0: Problem solved
	//1: Problem infeasible
	//2: Time limit exceeded
	short int Flag;

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

	//Total number of column generation iterations
	int TotalNumberOfIterations;

	//Found Value
	double FinalValue;

	//Value before adding inequalites
	double ValueBeforeInequalities;

	//Time:
	//Total time spent on initialization, prior to running PStep_Algorithm::ColumnGeneration().
	//This time is not included in total computation time, and is only used by PStep_Algorithm::SolveRootNode().
	double InitializationTime;

	//Total time in seconds of executing the algorithm
	double TotalComputationTime;

	//Time before adding inequalities
	double TimeBeforeInequalities;

	//Total time in seconds spent on solving the LP's
	double TotalLPTime;

	//Total time in seconds spent on solving the Pricing problems
	double TotalPricingTime;

	//Total time in seconds spent on seperating capacity cuts
	double TotalSeparateCCTime;

	//Total time in seconds spent on seperating 2 edge hypotour cuts
	double TotalSeparate2EHTime;

	//Total time in seconds spent on seperating strengthened comb cuts
	double TotalSeparateSCombTime;

	//Total time in seconds spent on seperating framed capacity cuts
	double TotalSeparateFCCTime;

	//Total time in seconds spent on seperating homogeneous multistar cuts
	double TotalSeparateHMCTime;

	//p-steps:
	//Total number of p-steps at the start of the algorithm
	int StartNumberOfPSteps;

	//Total number of PSteps in the model at termination
	int TotalNumberOfPSteps;

	//Capacity cuts:
	//Total number of capacity cuts at the start of the algorithm
	int StartNumberOfCC;

	//Total number of capacity cuts at termination
	int TotalNumberOfCC;

	//2 edge hypotour cuts:
	//Total number of 2 edge hypotour cuts at the start of the algorithm
	int StartNumberOf2EH;

	//Total number of 2 edge hypotour cuts at termination
	int TotalNumberOf2EH;

	//Strengthened comb cuts:
	//Total number of 2strentghened comb cuts at the start of the algorithm
	int StartNumberOfSComb;

	//Total number of strengthened comb cuts at termination
	int TotalNumberOfSComb;

	//Framed capacity cuts:
	//Total number of framed capacity cuts at the start of the algorithm
	int StartNumberOfFCC;

	//Total number of framed capacity cuts at termination
	int TotalNumberOfFCC;

	//Homogeneous multistar cuts:
	//Total number of homogeneous multistar cuts at the start of the algorithm
	int StartNumberOfHMC;

	//Total number of homogeneous multistar cuts at termination
	int TotalNumberOfHMC;

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

	//Default Constructor
	PStep_ColumnGenerationStatistics();

	//Copy Constructor
	PStep_ColumnGenerationStatistics(const PStep_ColumnGenerationStatistics &OriginalPStep_ColumnGenerationStatistics);

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

	//Assignment operator
	PStep_ColumnGenerationStatistics operator=(const PStep_ColumnGenerationStatistics &OriginalPStep_ColumnGenerationStatistics);

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

	//Default destructor
	~PStep_ColumnGenerationStatistics();

	//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_ColumnGenerationStatistics &OriginalPStep_ColumnGenerationStatistics);

};

#endif