/*Implementation of PStep_Algorithm.h

It contains the other functions of PStep_Algorithm

*/

#include "PStep_Algorithm.h"

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

//Get the potential column generation time
//It uses ListOfAllPricingProblemSequentialSolverSavingsTimers.front(0).TotalPotentialTimeSavings
//as total savings.
//It reports the total time taken by column generation minus these savings.
//NOTE: It simply report the column generation time if AlgorithmSettings.PricingProblemSelection is not 2.
double PStep_Algorithm::GetPotentialColumnGenerationTime(){

	//Initialize time
	double Time = AlgorithmMembers.CurrentCGStatistics.TotalComputationTime;

	//Check whether potential savings should have been registered.
	if (AlgorithmMembers.AlgorithmSettings.PricingProblemSelection == 2){
		//Update time
		Time -= ListOfAllPricingProblemSequentialSolverSavingsTimers.front().TotalPotentialTimeSavings;
	}

	return Time;

}

//Get the potential branch-price-and-cut generation time
//It uses ListOfAllPricingProblemSequentialSolverSavingsTimers.front(0).TotalPotentialTimeSavings
//as total savings.
//It reports the total time taken by branch-price-and-cut minus these savings.
//NOTE: It simply reports the branch-price-and-cut time if AlgorithmSettings.PricingProblemSelection is not 2.
double PStep_Algorithm::GetPotentialBranchPriceAndCutTime(){

	//Initialize time
	double Time = AlgorithmMembers.CurrentBPCStatistics.TotalTime;

	//Check whether potential savings should have been registered.
	if (AlgorithmMembers.AlgorithmSettings.PricingProblemSelection == 2){
		//Update time
		Time -= ListOfAllPricingProblemSequentialSolverSavingsTimers.front().TotalPotentialTimeSavings;
	}

	return Time;

}