BALL  1.5.0
partialBondOrderAssignment.h
Go to the documentation of this file.
1 #ifndef BALL_STRUCTURE_BONDORDERS_PARTIALBONDORDERASSIGNMENT_H
2 #define BALL_STRUCTURE_BONDORDERS_PARTIALBONDORDERASSIGNMENT_H
3 
4 #ifndef BALL_COMMON_GLOBAL_H
5 # include <BALL/COMMON/global.h>
6 #endif
7 
8 #ifndef BALL_KERNEL_ATOM_H
9 # include <BALL/KERNEL/atom.h>
10 #endif
11 
12 #ifndef BALL_KERNEL_BOND_H
13 # include <BALL/KERNEL/bond.h>
14 #endif
15 
16 #include <boost/shared_ptr.hpp>
17 #include <vector>
18 
19 namespace BALL
20 {
21  class AssignBondOrderProcessor;
22  class BondOrderAssignment;
23 
34  {
35  public:
36  // this enum allows faster access to the type of the chosen heuristic than a string compare
38  {
41  TIGHT
42  };
43 
44  // Constructor
46 
47  // Destructor
49 
50  boost::shared_ptr<BondOrderAssignment> convertToFullAssignment();
51 
52  //
53  void clear();
54 
55  // the less operator.
56  // NOTE: we want a reverse sort, hence we actually return a "greater"
58 
59  // the penalty
60  float coarsePenalty(float atom_type_penalty, float bond_length_penalty) const;
61 
62  // the combined penalty of structure and type penalty
63  float coarsePenalty() const;
64 
65  // the bond length penalty
66  float finePenalty() const {return estimated_bond_length_penalty;}
67 
69  float getAtomTypePenalty(bool include_heuristic_term = true, HEURISTIC_INDEX heuristic_index = SIMPLE);
70 
78  bool estimatePenalty_(bool include_heuristic_term = true, HEURISTIC_INDEX heuristic_index = SIMPLE);
79 
82  Index atom_index, // the atom index
83  int fixed_valence, // its so far fixed valence (incl. virtual H's)
84  int fixed_virtual_order, // its so far fixed virtual H's
85  int num_free_bonds, // its number of unfixed original bonds
86  HEURISTIC_INDEX heuristic_index);
87 
89  // NOTE: virtual bonds are excluded!
90  float estimateBondLengthPenalty_(Index atom_index, // the atom index
91  const vector<Bond*>& free_bonds,
92  int fixed_virtual_order,
93  int fixed_valence,
94  int num_free_bonds);
95 
96 
97  // the estimated atom type penalty
99  // the estimated bond length penalty
101 
102  // the bond orders
103  // the i-th entry denotes the bondorder of the i-th bond
104  // unset bonds get the order 0
105  vector<short> bond_orders;
106 
107  // the index of the bond last considered
109 
111  };
112 }
113 
114 #endif // BALL_STRUCTURE_BONDORDERS_PARTIALBONDORDERASSIGNMENT_H
Definition: constants.h:13
BALL_EXPORT bool operator<(const String &s1, const String &s2)
BALL_INDEX_TYPE Index
Assignment of bond orders from topology information.
A full or partial solution to the AStar-based bond order assignment problem.
bool estimatePenalty_(bool include_heuristic_term=true, HEURISTIC_INDEX heuristic_index=SIMPLE)
boost::shared_ptr< BondOrderAssignment > convertToFullAssignment()
float coarsePenalty(float atom_type_penalty, float bond_length_penalty) const
PartialBondOrderAssignment(AssignBondOrderProcessor *parent)
float getAtomTypePenalty(bool include_heuristic_term=true, HEURISTIC_INDEX heuristic_index=SIMPLE)
Convenience function to obtain total atom type penalty value.
float estimateAtomTypePenalty_(Atom *atom, Index atom_index, int fixed_valence, int fixed_virtual_order, int num_free_bonds, HEURISTIC_INDEX heuristic_index)
Estimates the atom type penalty for a given unclosed atom.
float estimateBondLengthPenalty_(Index atom_index, const vector< Bond * > &free_bonds, int fixed_virtual_order, int fixed_valence, int num_free_bonds)
Estimates the bond length penalty for a given unclosed atom.
#define BALL_EXPORT
Definition: COMMON/global.h:50