#ifndef _SOLUTION_H 
#define _SOLUTION_H 1

#include "players.h"


/**
 * This object holds a collection of 11 players which make up
 * a solution.
 *
 * Note that the solution may not be valid ..
 *
 */
class CSolution
{
 public:
  /**
   * Constructor.
   */
  CSolution();

  /** 
   * Destructor.
   */
  virtual ~CSolution();

 public:

  /**
   * Build up a team by randomly choosing 11 players.
   */
  void seedRandomly();

  /**
   * Calculate the fitness of this solution.
   * In our case the fitness is the thing that we're trying to increase,
   * so it's just the total of the points each player has.
   */
  int getFitness();


  /**
   * Display our team of 11 players.
   */
  void display( );


  /**
   * Breed this object with another object.
   * This is done without mutation and is a simple genome split.
   */
  CSolution & breed( CSolution partner );


  /**
   * Is the solution we've chosen valid?
   * If the cost of all the players is over 50 it's not.
   * If more than two players are on the same team it's not.
   * Otherwise it is.
   */
  int isValid();

 private:
  /**
   * The players in this solution's team.
   */
  CPlayer m_players[11];


};



#endif /* _SOLUTION_H */
