BALL
1.4.1
|
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).
AssignBondOrderProcessor bop; bop.options.setBool(AssignBondOrderProcessor::Option::COMPUTE_ALSO_NON_OPTIMAL_SOLUTIONS, true); ... sys.apply(bop); i = bop.getNumberOfComputedSolutions(); bop.apply(i-1); ... while (bop.computeNextSolution()) { i++; bop.apply(i); }
Definition at line 92 of file assignBondOrderProcessor.h.
Default Constructor.
virtual BALL::AssignBondOrderProcessor::~AssignBondOrderProcessor | ( | ) | [virtual] |
Destructor.
BALL::AssignBondOrderProcessor::AssignBondOrderProcessor | ( | const AssignBondOrderProcessor & | abop | ) | [protected] |
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!
i | index of the solution whose bond orders should be assigned. |
bool BALL::AssignBondOrderProcessor::apply_ | ( | BondOrderAssignment & | solution | ) | [protected] |
Applies the given solution.
Clears the data structures.
NOTE: The options remain! Use setDefaultOptions() to clear the options.
bool BALL::AssignBondOrderProcessor::computeNextSolution | ( | bool | apply_solution = true | ) |
Computes and applies one of the next best solutions.
Ignores the options MAX_NUMBER_OF_SOLUTIONS and COMPUTE_ALSO_NON_OPTIMAL_SOLUTIONS .
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.
atom | the atom, to which the virtual hydrogens should be added. |
Evaluates the AtomContainer's bond orders as specified in the Options and returns the computed penalty.
ac | AtomContainer, whose bond orders should be evaluated. |
virtual bool BALL::AssignBondOrderProcessor::finish | ( | ) | [virtual] |
Processor method which is called after the operator()-call.
Reimplemented from BALL::UnaryProcessor< AtomContainer >.
Returns a pointer to the original Molecule as AtomContainer.
Definition at line 376 of file assignBondOrderProcessor.h.
AtomContainer const* BALL::AssignBondOrderProcessor::getAtomContainer | ( | ) | const [inline] |
Returns a nonmutable pointer to the original Molecule as AtomContainer.
Definition at line 380 of file assignBondOrderProcessor.h.
Returns the number of added hydrogens in solution i.
NOTE: Hydrogens can only be added using the Option::ADD_HYDROGENS-option.
Definition at line 347 of file assignBondOrderProcessor.h.
Returns the number of already computed solutions.
NOTE: Having applied the operator with option Option Algorithm::A_STAR this method returns the number of optimal solutions+1!
Definition at line 371 of file assignBondOrderProcessor.h.
int BALL::AssignBondOrderProcessor::getNumberOfNodeExpansions | ( | Position | i | ) | [inline] |
Definition at line 435 of file assignBondOrderProcessor.h.
int BALL::AssignBondOrderProcessor::getNumberOfNodeExpansions_ | ( | const BondOrderAssignment & | sol | ) | [inline, protected] |
Definition at line 634 of file assignBondOrderProcessor.h.
int BALL::AssignBondOrderProcessor::getPenaltyClass_ | ( | Atom * | atom | ) | [protected] |
Finds the first matching SMARTS-expression in the penalty-vector and returns its index.
int | -1 if there is no matching expression |
int BALL::AssignBondOrderProcessor::getQueueSize | ( | Position | i | ) | [inline] |
Definition at line 452 of file assignBondOrderProcessor.h.
int BALL::AssignBondOrderProcessor::getQueueSize_ | ( | const BondOrderAssignment & | sol | ) | [inline, protected] |
Definition at line 598 of file assignBondOrderProcessor.h.
const System& BALL::AssignBondOrderProcessor::getSolution | ( | Position | i | ) | throw (Exception::IndexOverflow) |
Returns a reference to the original system to which solution i was applied.
NOTE: This method has the same effect as calling apply(i)!
i | index of the solution, whose bond order assignment should be applied. |
float BALL::AssignBondOrderProcessor::getTotalCharge | ( | Position | i | ) | [inline] |
Returns the total charge of solution i.
NOTE: This method is still experimental.
i | index of the solution, whose charge should be computed. |
Definition at line 399 of file assignBondOrderProcessor.h.
float BALL::AssignBondOrderProcessor::getTotalCharge_ | ( | const BondOrderAssignment & | sol | ) | [inline, protected] |
Returns the total charge of a solution.
sol | solution, whose charge should be computed. |
Definition at line 606 of file assignBondOrderProcessor.h.
float BALL::AssignBondOrderProcessor::getTotalPenalty | ( | Position | i = 0 | ) | [inline] |
Returns the total penalty of solution i.
i | index of the solution, whose penalty should be returned. |
Definition at line 418 of file assignBondOrderProcessor.h.
float BALL::AssignBondOrderProcessor::getTotalPenalty_ | ( | const BondOrderAssignment & | sol | ) | [inline, protected] |
Returns the total penalty of the given solution.
sol | solution, whose penalty should be returned. |
Definition at line 624 of file assignBondOrderProcessor.h.
bool BALL::AssignBondOrderProcessor::hasValidOptions | ( | ) | [inline] |
Checks the options.
Definition at line 500 of file assignBondOrderProcessor.h.
virtual Processor::Result BALL::AssignBondOrderProcessor::operator() | ( | AtomContainer & | ac | ) | [virtual] |
Operator () for the processor
Called with Default-options the processor computes all possible bond order assignments with optimal atomic penalty value and applies the first solution to the given AtomContainer.
NOTE: Having used the Algorithm::A_STAR-option (default) the method getNumberOfComputedSolutions() will return the number of optimal solutions+1!
ac | the AtomContainer to which the processor is applied. |
Reimplemented from BALL::UnaryProcessor< AtomContainer >.
AssignBondOrderProcessor& BALL::AssignBondOrderProcessor::operator= | ( | const AssignBondOrderProcessor & | abop | ) | [protected] |
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.
bool | - false if the AtomContainer to which the processor is applied to has an atom with no matching penalty block. |
bool | - true otherwise |
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.
bool | - false if the AtomContainer is invalid or the processor is in an invalid state |
bool | - true otherwise |
bool BALL::AssignBondOrderProcessor::readAtomPenalties_ | ( | ) | throw (Exception::FileNotFound()) [protected] |
Reads and stores the penalty-INIFile (for example BondOrder.ini).
bool BALL::AssignBondOrderProcessor::readOptions_ | ( | ) | [protected] |
Reads, checks and stores the options.
Resets all bond orders and assigned hydrogens.
Assigns the original bond order assignments to the AtomContainer we are operating on.
Resets the options to default values.
virtual bool BALL::AssignBondOrderProcessor::start | ( | ) | [virtual] |
Processor method which is called before the operator()-call.
Reimplemented from BALL::UnaryProcessor< AtomContainer >.
void BALL::AssignBondOrderProcessor::storeOriginalConfiguration_ | ( | ) | [protected] |
Stores the original configuration of the AtomContainer.
friend class AStarBondOrderStrategy [friend] |
Definition at line 104 of file assignBondOrderProcessor.h.
friend class BondOrderAssignment [friend] |
Definition at line 97 of file assignBondOrderProcessor.h.
friend class BondOrderAssignmentStrategy [friend] |
Definition at line 102 of file assignBondOrderProcessor.h.
friend class BranchAndBoundBondOrderStrategy [friend] |
Definition at line 105 of file assignBondOrderProcessor.h.
friend class FPTBondOrderStrategy [friend] |
Definition at line 106 of file assignBondOrderProcessor.h.
friend class ILPBondOrderStrategy [friend] |
Definition at line 107 of file assignBondOrderProcessor.h.
friend class KGreedyBondOrderStrategy [friend] |
Definition at line 108 of file assignBondOrderProcessor.h.
friend class PartialBondOrderAssignment [friend] |
Definition at line 96 of file assignBondOrderProcessor.h.
friend class PQ_Entry_ [friend] |
Definition at line 99 of file assignBondOrderProcessor.h.
AtomContainer* BALL::AssignBondOrderProcessor::ac_ [protected] |
Definition at line 708 of file assignBondOrderProcessor.h.
Definition at line 723 of file assignBondOrderProcessor.h.
float BALL::AssignBondOrderProcessor::alpha_ [protected] |
Definition at line 714 of file assignBondOrderProcessor.h.
vector< vector<int> > BALL::AssignBondOrderProcessor::atom_to_block_ [protected] |
Definition at line 752 of file assignBondOrderProcessor.h.
HashMap<Atom*, int> BALL::AssignBondOrderProcessor::atom_to_virtual_bond_index_ [protected] |
Definition at line 673 of file assignBondOrderProcessor.h.
Definition at line 698 of file assignBondOrderProcessor.h.
vector<std::pair<String, String> > BALL::AssignBondOrderProcessor::block_definition_ [protected] |
Definition at line 745 of file assignBondOrderProcessor.h.
vector<Size> BALL::AssignBondOrderProcessor::block_to_length_ [protected] |
Definition at line 742 of file assignBondOrderProcessor.h.
vector<Position> BALL::AssignBondOrderProcessor::block_to_start_idx_ [protected] |
Definition at line 741 of file assignBondOrderProcessor.h.
vector<int> BALL::AssignBondOrderProcessor::block_to_start_valence_ [protected] |
Definition at line 743 of file assignBondOrderProcessor.h.
std::map<Bond*, short> BALL::AssignBondOrderProcessor::bond_fixed_ [protected] |
Definition at line 644 of file assignBondOrderProcessor.h.
Definition at line 701 of file assignBondOrderProcessor.h.
HashMap<Bond*, vector<float> > BALL::AssignBondOrderProcessor::bond_lengths_penalties_ [protected] |
Definition at line 755 of file assignBondOrderProcessor.h.
HashMap<Bond*, Index> BALL::AssignBondOrderProcessor::bond_to_index_ [protected] |
Definition at line 650 of file assignBondOrderProcessor.h.
Definition at line 726 of file assignBondOrderProcessor.h.
Definition at line 720 of file assignBondOrderProcessor.h.
bool BALL::AssignBondOrderProcessor::evaluation_mode_ [protected] |
Processor is in an evaluation mode. Default is false.
Definition at line 640 of file assignBondOrderProcessor.h.
std::vector<Position> BALL::AssignBondOrderProcessor::fixed_val_ [protected] |
Definition at line 688 of file assignBondOrderProcessor.h.
std::vector<Bond*> BALL::AssignBondOrderProcessor::free_bonds_ [protected] |
Definition at line 647 of file assignBondOrderProcessor.h.
std::vector<Bond*> BALL::AssignBondOrderProcessor::index_to_bond_ [protected] |
Definition at line 653 of file assignBondOrderProcessor.h.
int BALL::AssignBondOrderProcessor::last_applied_solution_ [protected] |
Definition at line 705 of file assignBondOrderProcessor.h.
int BALL::AssignBondOrderProcessor::max_bond_order_ [protected] |
Definition at line 711 of file assignBondOrderProcessor.h.
int BALL::AssignBondOrderProcessor::max_number_of_solutions_ [protected] |
Definition at line 717 of file assignBondOrderProcessor.h.
int BALL::AssignBondOrderProcessor::num_of_free_bonds_ [protected] |
Definition at line 685 of file assignBondOrderProcessor.h.
Definition at line 669 of file assignBondOrderProcessor.h.
HashMap<Atom*, int> BALL::AssignBondOrderProcessor::number_of_virtual_hydrogens_ [protected] |
Definition at line 663 of file assignBondOrderProcessor.h.
the processor's options
Definition at line 515 of file assignBondOrderProcessor.h.
vector<int> BALL::AssignBondOrderProcessor::penalties_ [protected] |
Definition at line 740 of file assignBondOrderProcessor.h.
vector<BondOrderAssignment> BALL::AssignBondOrderProcessor::solutions_ [protected] |
Definition at line 691 of file assignBondOrderProcessor.h.
vector<BondOrderAssignment> BALL::AssignBondOrderProcessor::starting_configuration_ [protected] |
Definition at line 695 of file assignBondOrderProcessor.h.
StringHashMap<boost::shared_ptr<BondOrderAssignmentStrategy> > BALL::AssignBondOrderProcessor::strategies_ [protected] |
Definition at line 763 of file assignBondOrderProcessor.h.
Timer BALL::AssignBondOrderProcessor::timer_ [protected] |
Definition at line 757 of file assignBondOrderProcessor.h.
Definition at line 682 of file assignBondOrderProcessor.h.
Definition at line 729 of file assignBondOrderProcessor.h.
bool BALL::AssignBondOrderProcessor::valid_ [protected] |
Processor is in a useable valid state.
Definition at line 637 of file assignBondOrderProcessor.h.
Bond* BALL::AssignBondOrderProcessor::virtual_bond_ [protected] |
Definition at line 677 of file assignBondOrderProcessor.h.
vector<Atom*> BALL::AssignBondOrderProcessor::virtual_bond_index_to_atom_ [protected] |
Definition at line 672 of file assignBondOrderProcessor.h.
std::vector<int> BALL::AssignBondOrderProcessor::virtual_bond_index_to_number_of_virtual_hydrogens_ [protected] |
Definition at line 666 of file assignBondOrderProcessor.h.