#ifndef RESULT_TABLE_H
#define RESULT_TABLE_H

#define RT_DEFAULT_FILENAME "table.dat"

#define RT_NO_FILENAME_GIVEN 1
#define RT_FILE_ERROR 2

struct table_row {
  int updates;
  double avg_fitness;
  double best_fitness;
  double divergency;
  double elite;

  table_row() {
    updates = 0;
    avg_fitness = 0;
    best_fitness = 0;
    divergency = 0;
    elite = 0;
  }
};

class result_table {
  int rows;
  struct table_row *table;
public:
  result_table(int);
  ~result_table() { delete [] table; }

  int update_row(int, float, float, float, float);
  int print(char *p_filename = RT_DEFAULT_FILENAME);
};

#endif /* RESULT_TABLE_H */

