RxDock 0.1.0
A fast, versatile, and open-source program for docking ligands to proteins and nucleic acids
Loading...
Searching...
No Matches
GPParser.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// GPParser Class. Parses a genome from a cartesian GP
14
15#ifndef _RBT_GPPARSER_H_
16#define _RBT_GPPARSER_H_
17
18#include "rxdock/geneticprogram/Cell.h"
19#include "rxdock/geneticprogram/Command.h"
20#include "rxdock/geneticprogram/GPChromosome.h"
21#include "rxdock/geneticprogram/GPTypes.h"
22
23namespace rxdock {
24
25namespace geneticprogram {
26
27class GPParser {
28public:
29 static const std::string _CT;
31 // Constructors
33 GPParser(int, int, int, int);
34 GPParser(const GPParser &);
35
37 // Destructor
39 virtual ~GPParser();
40
41 void Clear();
42 std::ostream &Print(std::ostream &) const;
43 friend std::ostream &operator<<(std::ostream &s, const GPParser &p);
44 ReturnTypeList Parse(GPChromosomePtr, ReturnTypeList &);
45 std::string PrintParse(std::istream &, GPChromosomePtr, bool, bool);
46 bool IsConstantInt(int i) { return (i == CINT); }
47 bool IsConstantFloat(int i) { return (i == CFLOAT); }
48
49private:
51 // Private data
53 ReturnType Eval(GPChromosomePtr, int);
54 ReturnType Parse1Output(GPChromosomePtr, int);
55 std::string PrintEval(GPChromosomePtr, int, bool, bool);
56 std::string PrintParse1Output(GPChromosomePtr, int, bool, bool);
57 // GPChromosomePtr chrom;
58 // CellList cells;
59 CommandList commands;
60 int nProgramInputs, nFunctionsInputs, nProgramOutputs;
61 int ADD, SUB, MUL, DIV, IF, CINT, CFLOAT;
62};
63
64// Useful typedefs
65typedef SmartPtr<GPParser> GPParserPtr; // Smart pointer
66
67} // namespace geneticprogram
68
69} // namespace rxdock
70
71#endif //_GPParser_H_
Definition GPParser.h:27