source: src/Potentials/PotentialTrainer.hpp@ 91793c

Candidate_v1.7.0 stable
Last change on this file since 91793c was 82e5fb, checked in by Frederik Heber <frederik.heber@…>, 4 years ago

Added option error-file to fit potential actions.

  • Property mode set to 100644
File size: 1.8 KB
RevLine 
[98d166]1/*
2 * PotentialTrainer.hpp
3 *
4 * Created on: Sep 11, 2014
5 * Author: heber
6 */
7
8#ifndef POTENTIALTRAINER_HPP_
9#define POTENTIALTRAINER_HPP_
10
11// include config.h
12#ifdef HAVE_CONFIG_H
13#include <config.h>
14#endif
15
16#include <boost/filesystem/path.hpp>
17#include <vector>
18
19#include "Potentials/SerializablePotential.hpp"
20
21class element;
22class HomologyContainer;
23class HomologyGraph;
24
25/** This class is a functor for training a (compound) potential from homologies.
26 *
27 */
28class PotentialTrainer
29{
30public:
31 PotentialTrainer();
32 ~PotentialTrainer();
33
34 bool operator()(
35 const HomologyContainer &_homologies,
36 const HomologyGraph &_graph,
37 const boost::filesystem::path &_trainingfile,
[82e5fb]38 const boost::filesystem::path &_errorfile,
[b40690]39 const unsigned int _maxiterations,
[98d166]40 const double _threshold,
41 const unsigned int _best_of_howmany) const;
42
[945797]43 /** Get the first matching homologous graph based only on the number of nodes.
44 *
45 * We could directly access the equal_range in the HomologyContainer we if were
46 * specified the full HomologyGraph. However, if we have only get "CH4", then
47 * we lack the bonding structure, hence one half of the graph is missing.
48 *
49 * Therefore, we step through all graphs and get the first to match exactly
50 * with the number of specified element.s
51 *
52 * \param homologies container sorted by homologous fragments/graphs
53 * \param types fragment specification, e.g. "CH4"
54 * \return the first matching HomologyGraph
55 */
[98d166]56 static
57 HomologyGraph getFirstGraphwithSpecifiedElements(
58 const HomologyContainer &homologies,
59 const SerializablePotential::ParticleTypes_t &types);
60
61 static
62 SerializablePotential::ParticleTypes_t getNumbersFromElements(
63 const std::vector<const element *> &fragment);
64};
65
66
67#endif /* POTENTIALTRAINER_HPP_ */
Note: See TracBrowser for help on using the repository browser.