RbtGPFFHSP90.h 2 KB
Newer Older
pschmidtke's avatar
pschmidtke committed
1
/***********************************************************************
2 3 4 5 6 7 8 9 10 11
 * The rDock program was developed from 1998 - 2006 by the software team
 * at RiboTargets (subsequently Vernalis (R&D) Ltd).
 * In 2006, the software was licensed to the University of York for
 * maintenance and distribution.
 * In 2012, Vernalis and the University of York agreed to release the
 * program as Open Source software.
 * This version is licensed under GNU-LGPL version 3.0 with support from
 * the University of Barcelona.
 * http://rdock.sourceforge.net/
 ***********************************************************************/
pschmidtke's avatar
pschmidtke committed
12

13 14
// GPFFHSP90 Class. GPFFHSP90 represents a fitness function
// valid for the CGP. It is used to train with the HSP90 set.
pschmidtke's avatar
pschmidtke committed
15 16 17 18

#ifndef _RBT_GPFFHSP90_H_
#define _RBT_GPFFHSP90_H_

19 20 21
#include "RbtContext.h"
#include "RbtGPFitnessFunction.h"
#include "RbtGPGenome.h"
pschmidtke's avatar
pschmidtke committed
22 23 24
#include "RbtGPTypes.h"
#include "RbtRand.h"

25
class RbtGPFFHSP90 : public RbtGPFitnessFunction {
pschmidtke's avatar
pschmidtke committed
26
public:
27
  static std::string _CT;
28 29 30 31
  RbtGPFFHSP90(RbtContextPtr c) : contextp(c) {
    _RBTOBJECTCOUNTER_CONSTR_(_CT);
  }
  virtual ~RbtGPFFHSP90() { _RBTOBJECTCOUNTER_DESTR_(_CT); }
pschmidtke's avatar
pschmidtke committed
32

33
  void ReadTables(istream &, RbtReturnTypeArray &, RbtReturnTypeArray &);
34 35 36 37
  double CalculateFitness(RbtGPGenomePtr, RbtReturnTypeArray &,
                          RbtReturnTypeArray &, double, bool);
  double CalculateFitness(RbtGPGenomePtr, RbtReturnTypeArray &,
                          RbtReturnTypeArray &, bool);
pschmidtke's avatar
pschmidtke committed
38

39
private:
40
  void CreateRandomCtes(int);
41 42 43 44 45
  RbtDoubleList ctes;
  RbtCellContextPtr contextp;
  RbtGPFFHSP90(); // default constructor disabled
  RbtReturnTypeArray inputTestTable, inputTrainingTable;
  RbtReturnTypeArray sfTestTable, sfTrainingTable;
pschmidtke's avatar
pschmidtke committed
46 47
};

48 49 50
// Useful typedefs
typedef SmartPtr<RbtGPFFHSP90> RbtGPFFHSP90Ptr;   // Smart pointer
typedef vector<RbtGPFFHSP90Ptr> RbtGPFFHSP90List; // Vector of smart pointers
pschmidtke's avatar
pschmidtke committed
51 52 53
typedef RbtGPFFHSP90List::iterator RbtGPFFHSP90ListIter;
typedef RbtGPFFHSP90List::const_iterator RbtGPFFHSP90ListConstIter;
#endif //_RbtGPFFHSP90