/*
problem.h   Selah Lynch   July '04

Declarations and Documentation for class Problem

Class Problem:
Creates an object that stores a set of points to be connected by a genetic algorithm
Points can be read in from a file or created randomly on a 10x10 grid
Once a Problem object has been created it cannot be changed.

This class is independant of parallel computing and mpi.

*/



#ifndef PROBLEM_H
#define PROBLEM_H

#include <fstream.h>
#include <stdlib.h>

class Problem{
 public:
  Problem(int numpointsarg); 
  //make a random problem on a 10x10 grid

  Problem(char* filename);
  //reads points from file filename and make problem thus

  Problem(Problem& p);
  ~Problem();
  double GetX(int index);
  double GetY(int index);
  int GetNumPoints();

  void Display();

 private:
  void ReadPoints(char* filename);
  //reads pointsfile and allocates coords and sets them to values
  //also sets numpoints

  int numpoints;
  double **coords;

  static const int X=0, Y=1;

  static void check(bool b, char* mess);
  //checks is b is true, if not it displays mess and exits the program
};

#endif
