Changeset 9171d8


Ignore:
Timestamp:
Apr 23, 2021, 8:53:22 PM (5 years ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
Candidate_v1.7.0, stable
Children:
ff2c52
Parents:
1be100
git-author:
Frederik Heber <frederik.heber@…> (03/27/21 22:52:52)
git-committer:
Frederik Heber <frederik.heber@…> (04/23/21 20:53:22)
Message:

Using lowest contribution found in homology container.

  • also listing range of energy contributions found.
  • DOCU: Made note in userguide.
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • doc/userguide/userguide.xml

    r1be100 r9171d8  
    13451345        whether the molecule candidate is stable or not. Note that this requires
    13461346        that a suitable homology container file has been loaded first that contains
    1347         all necessary fragments.</para>
     1347        all necessary fragments. If multiple entries and thus multiple energies
     1348        are present for a given fragment, then the lowest energy is taken for the
     1349        summation.</para>
    13481350        <note>The graph is automatically saturated with hydrogens in obeying
    13491351        the octet rule, i.e. hydrogen should not be given in the list of elements.</note>
  • src/Actions/GraphAction/ChemicalSpaceEvaluatorAction.cpp

    r1be100 r9171d8  
    300300
    301301
     302bool compareEnergyContribution(
     303      const std::pair<const HomologyGraph, HomologyContainer::value_t> &a,
     304      const std::pair<const HomologyGraph, HomologyContainer::value_t> &b) {
     305  return a.second.energy < b.second.energy;
     306}
     307
    302308ActionState::ptr GraphChemicalSpaceEvaluatorAction::performCall() {
    303309  /// 1. create boost::graph from graph6 string
     
    530536        ELOG(1, "Cannot find fragment graph " << nodes_graph << " to graph " << elementnumbers);
    531537      } else {
    532         // list first energy
    533         LOG(1, "Fragment graph " << nodes_graph << " has contribution " << range.first->second.energy);
    534         total_energy += range.first->second.energy;
     538        // list lowest energy
     539        const HomologyContainer::const_iterator lowest_contribution_graph =
     540            std::min_element(range.first, range.second, compareEnergyContribution);
     541        const HomologyContainer::const_iterator highest_contribution_graph =
     542            std::max_element(range.first, range.second, compareEnergyContribution);
     543        LOG(2, "INFO: Fragment graph " << nodes_graph << " has energy contributions from "
     544            << lowest_contribution_graph->second.energy << " Ht till "
     545            << highest_contribution_graph->second.energy << " Ht, picking lowest.");
     546        total_energy += lowest_contribution_graph->second.energy;
    535547      }
    536548    }
Note: See TracChangeset for help on using the changeset viewer.