/****************************************************************
 *      Program Solving the KNAPSACK problem (task 3)  		*
 *      Author Jakub Holy                                       *
 *      For the subject PAA, LS2002                             *
 *	common.hh - stuff used by more files                    *
 ****************************************************************
 */


using namespace std;
#include <ostream>

#ifndef _COMMON_H
#define _COMMON_H
#endif
/** Interface for the various search algorithms
 *  (HeuristicAlgorithm ...)
 */
class SearchAlgorithm {
protected:
  int task_id;
  int solution_cost;			// total cost of the solution
  int nr_steps;				// 
public:
  virtual void solve(void) = 0;		// abstract method
  // Standardized output to an output stream:
  void printResult(ostream &str) { str << task_id <<" "<< nr_steps <<" "<< solution_cost << endl; }
  virtual void printAnyResult(ostream &str) = 0;
  SearchAlgorithm(int id){ task_id = id; solution_cost = nr_steps = 0; }
};// SearchAlgorithm