Assignment of bond orders from topology information.
More...
#include <BALL/STRUCTURE/assignBondOrderProcessor.h>
Assignment of bond orders from topology information.
Called with default options the processor computes up to Default::MAX_NUMBER_OF_SOLUTIONS many possible bond orders with optimal value and applies the first solution found to the given AtomContainer.
All further optimal solutions can be applied by calling the method apply() . Additional solutions can be computed by calling the method computeNextSolution() (except when using the FPT strategy which currently does not support this behaviour).
Example code:
...
sys.apply(bop);
i = bop.getNumberOfComputedSolutions();
bop.apply(i-1);
...
while (bop.computeNextSolution())
{
i++;
bop.apply(i);
}
AssignBondOrderProcessor()
Default Constructor.
static const char * COMPUTE_ALSO_NON_OPTIMAL_SOLUTIONS
Definition at line 88 of file assignBondOrderProcessor.h.
◆ AssignBondOrderProcessor() [1/2]
| BALL::AssignBondOrderProcessor::AssignBondOrderProcessor |
( |
| ) |
|
◆ ~AssignBondOrderProcessor()
| virtual BALL::AssignBondOrderProcessor::~AssignBondOrderProcessor |
( |
| ) |
|
|
virtual |
◆ AssignBondOrderProcessor() [2/2]
◆ apply()
Applies the i-th precomputed bond order assignment.
Sets the AtomContainer's bond orders to the ones found in the (already computed!) i-th solution, start counting at 0!
- NOTE: All virtual hydrogens added to the processed AtomContainer by a previous call of apply will be deleted by the current call!
- Parameters
-
| i | index of the solution whose bond orders should be assigned. |
- Returns
- bool - true if the i-th solution is valid, false otherwise.
◆ apply_()
Applies the given solution.
◆ clear()
| void BALL::AssignBondOrderProcessor::clear |
( |
| ) |
|
Clears the data structures.
NOTE: The options remain! Use setDefaultOptions() to clear the options.
◆ computeNextSolution()
| bool BALL::AssignBondOrderProcessor::computeNextSolution |
( |
bool |
apply_solution = true | ) |
|
◆ computeVirtualHydrogens_()
| float BALL::AssignBondOrderProcessor::computeVirtualHydrogens_ |
( |
Atom * |
atom | ) |
|
|
protected |
Adds missing hydrogens as virtual hydrogens to the given atom, determines the possible penalty blocks, and returns the maximal possible atom type penalty.
"virtual" means that NO
atoms and bonds are added to the original AtomContainer.
- Parameters
-
| atom | the atom, to which the virtual hydrogens should be added. |
- Returns
- float - the max possible penalty the atom can get, if hydrogen(s) are added.
- See also
- Option::ADD_HYDROGENS
◆ evaluatePenalty()
| float BALL::AssignBondOrderProcessor::evaluatePenalty |
( |
AtomContainer * |
ac | ) |
|
Evaluates the AtomContainer's bond orders as specified in the Options and returns the computed penalty.
- Parameters
-
- Returns
- float - computed penalty, -1 if current assignment is not valid or includes aromatic bonds.
◆ finish()
| virtual bool BALL::AssignBondOrderProcessor::finish |
( |
| ) |
|
|
virtual |
◆ getAtomContainer() [1/2]
| AtomContainer* BALL::AssignBondOrderProcessor::getAtomContainer |
( |
| ) |
|
|
inline |
◆ getAtomContainer() [2/2]
| AtomContainer const* BALL::AssignBondOrderProcessor::getAtomContainer |
( |
| ) |
const |
|
inline |
◆ getNumberOfAddedHydrogens()
| Size BALL::AssignBondOrderProcessor::getNumberOfAddedHydrogens |
( |
Position |
i | ) |
|
|
inline |
◆ getNumberOfComputedSolutions()
| Size BALL::AssignBondOrderProcessor::getNumberOfComputedSolutions |
( |
| ) |
|
|
inline |
◆ getNumberOfNodeExpansions()
| int BALL::AssignBondOrderProcessor::getNumberOfNodeExpansions |
( |
Position |
i | ) |
|
|
inline |
◆ getNumberOfNodeExpansions_()
| int BALL::AssignBondOrderProcessor::getNumberOfNodeExpansions_ |
( |
const BondOrderAssignment & |
sol | ) |
|
|
inlineprotected |
◆ getPenaltyClass_()
| int BALL::AssignBondOrderProcessor::getPenaltyClass_ |
( |
Atom * |
atom | ) |
|
|
protected |
Finds the first matching SMARTS-expression in the penalty-vector and returns its index.
- Return values
-
| int | -1 if there is no matching expression |
◆ getQueueSize()
| int BALL::AssignBondOrderProcessor::getQueueSize |
( |
Position |
i | ) |
|
|
inline |
◆ getQueueSize_()
◆ getSolution()
| const System& BALL::AssignBondOrderProcessor::getSolution |
( |
Position |
i | ) |
|
Returns a reference to the original system to which solution i was applied.
NOTE: This method has the same effect as calling apply(i)!
- Parameters
-
| i | index of the solution, whose bond order assignment should be applied. |
- Returns
- const System& - the original system with bond order assignment of solution i. If i is invalid, an Exception is thrown.
- Exceptions
-
◆ getTotalCharge()
| float BALL::AssignBondOrderProcessor::getTotalCharge |
( |
Position |
i | ) |
|
|
inline |
Returns the total charge of solution i.
NOTE: This method is still experimental.
- Parameters
-
| i | index of the solution, whose charge should be computed. |
- Returns
- float - total charge of solution i.
Definition at line 415 of file assignBondOrderProcessor.h.
◆ getTotalCharge_()
Returns the total charge of a solution.
- Parameters
-
| sol | solution, whose charge should be computed. |
- Returns
- float - total charge of the given solution.
Definition at line 623 of file assignBondOrderProcessor.h.
◆ getTotalPenalty()
| float BALL::AssignBondOrderProcessor::getTotalPenalty |
( |
Position |
i = 0 | ) |
|
|
inline |
Returns the total penalty of solution i.
- Parameters
-
| i | index of the solution, whose penalty should be returned. |
- Returns
- float - total penalty of solution i.
Definition at line 434 of file assignBondOrderProcessor.h.
◆ getTotalPenalty_()
◆ hasValidOptions()
| bool BALL::AssignBondOrderProcessor::hasValidOptions |
( |
| ) |
|
|
inline |
◆ operator()()
◆ operator=()
◆ preassignPenaltyClasses_()
| bool BALL::AssignBondOrderProcessor::preassignPenaltyClasses_ |
( |
| ) |
|
|
protected |
Assigns every atom of the AtomContainer to which the processor is applied to a block of possible valences and the corresponding penalties.
- Return values
-
| bool | - false if the AtomContainer to which the processor is applied to has an atom with no matching penalty block. |
| bool | - true otherwise |
◆ precomputeBondLengthPenalties_()
| bool BALL::AssignBondOrderProcessor::precomputeBondLengthPenalties_ |
( |
| ) |
|
|
protected |
Precomputes for every bond of the AtomContainer, to which the processor is applied to, the possible bond length penalties resulting from deviation of the actual bond length to a standard length for bonds with same atom types and the chosen bond order.
- If there is no information for certain atom pairs, penalty 0 is assumed. In case of incomplete information, we assume the missing bond orders to be really unlikely and we set a penalty to 2* max_deviation_found (for this bond).
- Return values
-
| bool | - false if the AtomContainer is invalid or the processor is in an invalid state |
| bool | - true otherwise |
◆ readAtomPenalties_()
| bool BALL::AssignBondOrderProcessor::readAtomPenalties_ |
( |
| ) |
|
|
protected |
Reads and stores the penalty-INIFile (for example BondOrder.ini).
- Returns
- bool - false if the INIFile could not be read correctly.
- Exceptions
-
◆ readOptions_()
| bool BALL::AssignBondOrderProcessor::readOptions_ |
( |
| ) |
|
|
protected |
Reads, checks and stores the options.
- Returns
- bool - false if one of the options got an invalid value.
-
bool - true otherwise
◆ resetBondOrders()
| void BALL::AssignBondOrderProcessor::resetBondOrders |
( |
| ) |
|
Resets all bond orders and assigned hydrogens.
Assigns the original bond order assignments to the AtomContainer we are operating on.
◆ setDefaultOptions()
| void BALL::AssignBondOrderProcessor::setDefaultOptions |
( |
| ) |
|
Resets the options to default values.
◆ start()
| virtual bool BALL::AssignBondOrderProcessor::start |
( |
| ) |
|
|
virtual |
◆ storeOriginalConfiguration_()
| void BALL::AssignBondOrderProcessor::storeOriginalConfiguration_ |
( |
| ) |
|
|
protected |
◆ AStarBondOrderStrategy
◆ BondOrderAssignment
◆ BondOrderAssignmentStrategy
◆ BranchAndBoundBondOrderStrategy
◆ FPTBondOrderStrategy
◆ ILPBondOrderStrategy
◆ KGreedyBondOrderStrategy
◆ PartialBondOrderAssignment
◆ PQ_Entry_
◆ ac_
◆ add_missing_hydrogens_
| bool BALL::AssignBondOrderProcessor::add_missing_hydrogens_ |
|
protected |
◆ alpha_
| float BALL::AssignBondOrderProcessor::alpha_ |
|
protected |
◆ atom_to_block_
| vector< vector<int> > BALL::AssignBondOrderProcessor::atom_to_block_ |
|
protected |
◆ atom_to_virtual_bond_index_
| HashMap<Atom*, int> BALL::AssignBondOrderProcessor::atom_to_virtual_bond_index_ |
|
protected |
◆ atom_type_normalization_factor_
| float BALL::AssignBondOrderProcessor::atom_type_normalization_factor_ |
|
protected |
◆ block_definition_
| vector<std::pair<String, String> > BALL::AssignBondOrderProcessor::block_definition_ |
|
protected |
◆ block_to_length_
| vector<Size> BALL::AssignBondOrderProcessor::block_to_length_ |
|
protected |
◆ block_to_start_idx_
| vector<Position> BALL::AssignBondOrderProcessor::block_to_start_idx_ |
|
protected |
◆ block_to_start_valence_
| vector<int> BALL::AssignBondOrderProcessor::block_to_start_valence_ |
|
protected |
◆ bond_fixed_
| std::map<Bond*, short> BALL::AssignBondOrderProcessor::bond_fixed_ |
|
protected |
◆ bond_length_normalization_factor_
| float BALL::AssignBondOrderProcessor::bond_length_normalization_factor_ |
|
protected |
◆ bond_lengths_penalties_
| HashMap<Bond*, vector<float> > BALL::AssignBondOrderProcessor::bond_lengths_penalties_ |
|
protected |
◆ bond_to_index_
◆ compute_also_connectivity_
| bool BALL::AssignBondOrderProcessor::compute_also_connectivity_ |
|
protected |
◆ compute_also_non_optimal_solutions_
| bool BALL::AssignBondOrderProcessor::compute_also_non_optimal_solutions_ |
|
protected |
◆ evaluation_mode_
| bool BALL::AssignBondOrderProcessor::evaluation_mode_ |
|
protected |
◆ fixed_val_
| std::vector<Position> BALL::AssignBondOrderProcessor::fixed_val_ |
|
protected |
◆ free_bonds_
| std::vector<Bond*> BALL::AssignBondOrderProcessor::free_bonds_ |
|
protected |
◆ index_to_bond_
| std::vector<Bond*> BALL::AssignBondOrderProcessor::index_to_bond_ |
|
protected |
◆ last_applied_solution_
| int BALL::AssignBondOrderProcessor::last_applied_solution_ |
|
protected |
◆ max_bond_order_
| int BALL::AssignBondOrderProcessor::max_bond_order_ |
|
protected |
◆ max_number_of_solutions_
| int BALL::AssignBondOrderProcessor::max_number_of_solutions_ |
|
protected |
◆ max_penalty_
| int BALL::AssignBondOrderProcessor::max_penalty_ |
|
protected |
◆ num_of_free_bonds_
| int BALL::AssignBondOrderProcessor::num_of_free_bonds_ |
|
protected |
◆ num_of_virtual_bonds_
| Size BALL::AssignBondOrderProcessor::num_of_virtual_bonds_ |
|
protected |
◆ number_of_virtual_hydrogens_
| HashMap<Atom*, int> BALL::AssignBondOrderProcessor::number_of_virtual_hydrogens_ |
|
protected |
◆ options
| Options BALL::AssignBondOrderProcessor::options |
◆ penalties_
| vector<int> BALL::AssignBondOrderProcessor::penalties_ |
|
protected |
◆ solutions_
◆ starting_configuration_
◆ strategies_
◆ timer_
| Timer BALL::AssignBondOrderProcessor::timer_ |
|
protected |
◆ total_num_of_bonds_
| Position BALL::AssignBondOrderProcessor::total_num_of_bonds_ |
|
protected |
◆ use_fine_penalty_
| bool BALL::AssignBondOrderProcessor::use_fine_penalty_ |
|
protected |
◆ valid_
| bool BALL::AssignBondOrderProcessor::valid_ |
|
protected |
◆ virtual_bond_
| Bond* BALL::AssignBondOrderProcessor::virtual_bond_ |
|
protected |
◆ virtual_bond_index_to_atom_
| vector<Atom*> BALL::AssignBondOrderProcessor::virtual_bond_index_to_atom_ |
|
protected |
◆ virtual_bond_index_to_number_of_virtual_hydrogens_
| std::vector<int> BALL::AssignBondOrderProcessor::virtual_bond_index_to_number_of_virtual_hydrogens_ |
|
protected |