#ifndef SIMULATION_FITNESS_H
#define SIMULATION_FITNESS_H

#include "generic_individual.h"
#include "generic_fitness.h"

#define SF_OV_FILE_ERROR -1

#define SF_PR_FILE_ERROR -10
#define SF_PR_VALUE_NOT_FOUND -11

class simulation_fitness : public generic_fitness {
  char *simulator_name;
  char *pattern_file;
  char *bench_file;
  char **report_element;

  bool set_simulator_name(char *);
  bool set_pattern_file(char *);
  bool set_bench_file(char *);
  bool set_report_element(char **, int);

  int output_matrix_vectors(ofstream&, GENE *, GENE *, int, int);
  int output_rule_vectors(ofstream&, int *, GENE *, int, int);
  int output_vectors(generic_individual *, int);

  float parse_report(char *);

  float parent_behaviour(int *, pid_t);
  void child_behaviour(int *, generic_individual *, int);
public:
  simulation_fitness(int *, int, char *, char *, char *, char **,
      int);

  simulation_fitness(int, char *, char *, char *, char **, int);
  ~simulation_fitness();

  float get_fitness(generic_individual *, int);
};

#endif /* SIMULATION_FITNESS_H */

