RxDock 0.1.0
A fast, versatile, and open-source program for docking ligands to proteins and nucleic acids
Loading...
Searching...
No Matches
GPFitnessFunction.h
1/***********************************************************************
2 * The rDock program was developed from 1998 - 2006 by the software team
3 * at RiboTargets (subsequently Vernalis (R&D) Ltd).
4 * In 2006, the software was licensed to the University of York for
5 * maintenance and distribution.
6 * In 2012, Vernalis and the University of York agreed to release the
7 * program as Open Source software.
8 * This version is licensed under GNU-LGPL version 3.0 with support from
9 * the University of Barcelona.
10 * http://rdock.sourceforge.net/
11 ***********************************************************************/
12
13// GPFitnessFunction Class. GPFitnessFunction represents a fitness function
14// valid for the CGP
15
16#ifndef _RBT_GPFITNESSFUNCTION_H_
17#define _RBT_GPFITNESSFUNCTION_H_
18
19#include "rxdock/Context.h"
20#include "rxdock/Rand.h"
21#include "rxdock/geneticprogram/GPGenome.h"
22#include "rxdock/geneticprogram/GPTypes.h"
23// #include <cmath>
24
25namespace rxdock {
26
27namespace geneticprogram {
28
30public:
31 static const std::string _CT;
33 // Constructors
37
38 GPFitnessFunction &operator=(const GPFitnessFunction &);
39
41 // Destructor
43 virtual ~GPFitnessFunction();
44 virtual void ReadTables(std::istream &, ReturnTypeArray &,
45 ReturnTypeArray &) = 0;
46 double GetObjective() const;
47 double GetFitness() const;
48 void SetFitness(double);
49 virtual double CalculateFitness(GPGenomePtr, ReturnTypeArray &,
50 ReturnTypeArray &, double, bool) = 0;
51 virtual double CalculateFitness(GPGenomePtr, ReturnTypeArray &,
52 ReturnTypeArray &, bool) = 0;
53
54protected:
55 Rand &m_rand;
56 double objective; // raw score
57 double fitness; // scaled score
58 ReturnTypeArray inputTable, SFTable;
59
60private:
61};
62
63// Useful typedefs
65typedef std::vector<GPFitnessFunctionPtr>
66 GPFitnessFunctionList; // Vector of smart pointers
67typedef GPFitnessFunctionList::iterator GPFitnessFunctionListIter;
68typedef GPFitnessFunctionList::const_iterator GPFitnessFunctionListConstIter;
69
70} // namespace geneticprogram
71
72} // namespace rxdock
73
74#endif //_GPFitnessFunction
Definition Rand.h:32
Definition SmartPointer.h:48
Definition GPFitnessFunction.h:29