5 #ifndef BALL_STRUCTURE_ASSIGNBONDORDERPROCESSOR_H
6 #define BALL_STRUCTURE_ASSIGNBONDORDERPROCESSOR_H
8 #ifndef BALL_CONCEPT_PROCESSOR_H
12 #ifndef BALL_KERNEL_ATOMCONTAINER_H
16 #ifndef BALL_DATATYPE_HASHMAP_H
20 #ifndef BALL_DATATYPE_HASHSET_H
24 #ifndef BALL_KERNEL_BOND_H
28 #ifndef BALL_DATATYPE_OPTIONS_H
32 #ifndef BALL_COMMON_EXCEPTION_H
36 #ifndef BALL_SYSTEM_TIMER_H
40 #ifndef BALL_STRUCTURE_BONDORDERS_BONDORDERASSIGNMENTSTRATEGY_H
44 #ifndef BALL_STRUCTURE_BONDORDERS_BONDORDERASSIGNMENT_H
48 #ifndef BALL_STRUCTURE_BONDORDERS_PARTIALBONDORDERASSIGNMENT_H
96 friend class PQ_Entry_;
321 virtual bool start();
346 virtual bool finish();
364 if (i >= solutions_.size())
366 Log.
error() <<
"AssignBondOrderProcessor: No solution with index " << i << std::endl;
369 int num_hydrogens = 0;
372 for (; it != solutions_[i].number_of_virtual_hydrogens.end(); it++)
373 num_hydrogens += it->second;
374 return num_hydrogens;
416 if (i >= solutions_.size())
418 Log.
error() <<
"AssignBondOrderProcessor: No solution with index " << i << std::endl;
424 return getTotalCharge_(solutions_[i]);
435 if (i >= solutions_.size())
437 Log.
error() <<
"AssignBondOrderProcessor: No solution with index " << i << std::endl;
442 return getTotalPenalty_(solutions_[i]);
452 if (i >= solutions_.size())
454 Log.
error() <<
"AssignBondOrderProcessor: No solution with index " << i << std::endl;
459 return getNumberOfNodeExpansions_(solutions_[i]);
469 if (i >= solutions_.size())
471 Log.
error() <<
"AssignBondOrderProcessor: No solution with index " << i << std::endl;
476 return getQueueSize_(solutions_[i]);
498 void resetBondOrders();
507 bool computeNextSolution(
bool apply_solution =
true);
511 void setDefaultOptions();
548 bool readAtomPenalties_() throw(Exception::FileNotFound());
558 bool preassignPenaltyClasses_();
566 int getPenaltyClass_(
Atom* atom);
584 bool precomputeBondLengthPenalties_();
597 float computeVirtualHydrogens_(
Atom* atom);
606 void storeOriginalConfiguration_();
787 #endif // BALL_STRUCTURE_ASSIGNBONDORDERPROCESSOR_H
vector< Position > block_to_start_idx_
bool add_missing_hydrogens_
float getTotalCharge(Position i)
vector< Atom * > virtual_bond_index_to_atom_
float coarsePenalty(float atom_type_penalty, float bond_length_penalty) const
Assignment of bond orders from topology information.
static const bool OVERWRITE_DOUBLE_BOND_ORDERS
Position total_num_of_bonds_
AtomContainer const * getAtomContainer() const
HashMap< Bond *, Index > bond_to_index_
static const int MAX_NUMBER_OF_SOLUTIONS
vector< Size > block_to_length_
Size getNumberOfAddedHydrogens(Position i)
static const bool USE_FINE_PENALTY
vector< BondOrderAssignment > solutions_
std::vector< Bond * > free_bonds_
static const bool KEKULIZE_RINGS
static const int MAX_PENALTY
static const char * APPLY_FIRST_SOLUTION
static const char * MAX_NUMBER_OF_SOLUTIONS
static const int MAX_BOND_ORDER
float bond_length_normalization_factor_
static const String BRANCH_AND_BOUND
float getTotalCharge_(const BondOrderAssignment &sol)
A solution to the bond order assignment problem.
std::vector< int > virtual_bond_index_to_number_of_virtual_hydrogens_
int last_applied_solution_
vector< int > block_to_start_valence_
int getNumberOfNodeExpansions() const
vector< BondOrderAssignment > starting_configuration_
Size num_of_virtual_bonds_
static const String INIFile
BALL_EXPORT LogStream Log
StringHashMap< boost::shared_ptr< BondOrderAssignmentStrategy > > strategies_
vector< vector< int > > atom_to_block_
static const bool OVERWRITE_SELECTED_BONDS
static const char * COMPUTE_ALSO_NON_OPTIMAL_SOLUTIONS
static const char * ALGORITHM
static const bool ADD_HYDROGENS
static const bool COMPUTE_ALSO_NON_OPTIMAL_SOLUTIONS
static const char * INIFile
std::vector< Position > fixed_val_
static const char * USE_FINE_PENALTY
T max(const T &a, const T &b)
static const float CONNECTIVITY_CUTOFF
static const String K_GREEDY
static const char * KEKULIZE_RINGS
int getNumberOfNodeExpansions(Position i)
static const String A_STAR
AtomContainer * getAtomContainer()
bool valid_
Processor is in a useable valid state.
Default values for options.
static const char * MAX_PENALTY
float atom_type_normalization_factor_
static const String ALGORITHM
LogStream & error(int n=0)
static const char * CONNECTIVITY_CUTOFF
static const char * COMPUTE_ALSO_CONNECTIVITY
static const char * OVERWRITE_SINGLE_BOND_ORDERS
Size getNumberOfComputedSolutions()
float getTotalPenalty(Position i=0)
vector< std::pair< String, String > > block_definition_
static const char * OVERWRITE_DOUBLE_BOND_ORDERS
std::vector< Bond * > index_to_bond_
HashMap< Atom *, int > atom_to_virtual_bond_index_
HashMap< Bond *, vector< float > > bond_lengths_penalties_
std::map< Bond *, short > bond_fixed_
static const char * BOND_LENGTH_WEIGHTING
static const bool COMPUTE_ALSO_CONNECTIVITY
static const bool OVERWRITE_SINGLE_BOND_ORDERS
float getTotalPenalty_(const BondOrderAssignment &sol)
int getNumberOfNodeExpansions_(const BondOrderAssignment &sol)
static const float BOND_LENGTH_WEIGHTING
static const char * ADD_HYDROGENS
int max_number_of_solutions_
static const bool APPLY_FIRST_SOLUTION
int getQueueSize(Position i)
bool compute_also_non_optimal_solutions_
HashMap class based on the STL map (containing serveral convenience functions)
bool evaluation_mode_
Processor is in an evaluation mode. Default is false.
Base class for bond order assignment algorithms.
static const char * OVERWRITE_SELECTED_BONDS
HashMap< Atom *, int > number_of_virtual_hydrogens_
static const char * MAX_BOND_ORDER
A full or partial solution to the AStar-based bond order assignment problem.
static const bool OVERWRITE_TRIPLE_BOND_ORDERS
static const char * OVERWRITE_TRIPLE_BOND_ORDERS
bool compute_also_connectivity_