[Echempp-devel] Experiment/Experiment Experiment.hpp,1.3,1.4
Status: Beta
Brought to you by:
berndspeiser
|
From: beeblbrox <bee...@us...> - 2007-04-11 08:25:40
|
Update of /cvsroot/echempp/Experiment/Experiment In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv30627 Modified Files: Experiment.hpp Log Message: Added basic documentation of classes. Remove method for Compound. Index: Experiment.hpp =================================================================== RCS file: /cvsroot/echempp/Experiment/Experiment/Experiment.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Experiment.hpp 10 Apr 2007 09:17:24 -0000 1.3 --- Experiment.hpp 11 Apr 2007 08:25:35 -0000 1.4 *************** *** 33,37 **** { ! // Unary functor for deletion template<typename Obj> class functor_delete --- 33,37 ---- { ! //! Unary functor for deletion. template<typename Obj> class functor_delete *************** *** 46,61 **** }; namespace realism { ! struct Simulated{}; struct Real{}; struct Dual{}; } namespace dynamics { struct Dynamic{}; struct Static{}; } class ExperimentException { --- 46,74 ---- }; + //! Namespace for realism types. namespace realism { ! //! Type used to designate simulated experiments. ! struct Simulated{}; ! //! Type used to designate real experiments. struct Real{}; + //! Type used to designate dual experiments, e.g. one part real the other simulated. struct Dual{}; } + //! Namespace for dynamics types. namespace dynamics { + //! Type used to designate dynamic experiments. struct Dynamic{}; + //! Type used to designate static experiments. struct Static{}; } + //! Exception class for experiment module. + //! This exception is thrown for example, when violation of + //! Experiment container invariants occurs. + //! \sa Homogeneous + //! \sa Sequential + //! \sa Simultaneous class ExperimentException { *************** *** 71,74 **** --- 84,88 ---- }; + //! Base class for all experiments. class Experiment { *************** *** 79,82 **** --- 93,97 ---- virtual void perform() = 0; virtual void add(Experiment* e) = 0; + virtual void remove(const size_t idx) = 0; virtual const Loki::TypeInfo get_independent_type() const = 0; virtual const Loki::TypeInfo get_dependent_type() const = 0; *************** *** 102,105 **** --- 117,123 ---- }; + //! Base class for all atomic experiments. + //! Atomic experiments are used to represent self-contained + //! experiments that are not further divisible. template<class Realism, class Dynamics> *************** *** 126,129 **** --- 144,151 ---- throw ExperimentException("Adding to Atomic not possible!"); } + void remove(const size_t idx) + { + throw ExperimentException("Removing from Atomic not possible!"); + } private: friend class boost::serialization::access; *************** *** 135,138 **** --- 157,165 ---- }; + //! Class to represent Actions. + //! Actions are used to influence the experimental system + //! without collecting data. + //! \sa Induced + //! \sa Observation template<class Realism, class Dynamics, *************** *** 229,233 **** ExcitationFunctions::DIExcitationFunction<D,I> exc_func; }; ! template<class Realism, class Dynamics, --- 256,265 ---- ExcitationFunctions::DIExcitationFunction<D,I> exc_func; }; ! ! //! Class to represent induced experiments. ! //! Induced experiments influence the system like Action but ! //! also collect the result. ! //! \sa Action ! //! \sa Observation template<class Realism, class Dynamics, *************** *** 327,330 **** --- 359,368 ---- }; + //! Class to represent Observations. + //! Dynamic Observations collect information about the + //! relationship between independent and result variable. + //! Static Observations collect a single result. + //! \sa Action + //! \sa Induced template<class Realism, class Dynamics, *************** *** 457,460 **** --- 495,503 ---- }; + //! Base class for all composed experiments. + //! \sa Collection + //! \sa Homogeneous + //! \sa Sequential + //! \sa Simultaneous class Compound : public Experiment { *************** *** 474,477 **** --- 517,527 ---- elements.push_back(e); } + void remove(const size_t idx) + { + if(idx > elements.size()-1) + throw ExperimentException("Index out of range!"); + delete elements[idx]; + elements.erase(elements.begin()+idx); + } int num_elements() const { *************** *** 591,594 **** --- 641,650 ---- }; + //! Class for collection of experiments. + //! A collection of experiments, where no contraint on the + //! type of contained experiments is placed. + //! \sa Homogeneous + //! \sa Sequential + //! \sa Simultaneous class Collection : public Compound { *************** *** 606,609 **** --- 662,673 ---- }; + //! Class for homogeneous composition of experiments. + //! A homogeneous composition contains only experiments with + //! the same type (w.r.t independent, dependent, result, dynamics + //! and realism type). Mixtures of atomic and composed Experiments + //! are not allowed. + //! \sa Collection + //! \sa Sequential + //! \sa Simultaneous class Homogeneous : public Compound { *************** *** 647,650 **** --- 711,720 ---- }; + //! Class for sequential composition of experiments. + //! A sequential composition may contain experiments which are dynamic + //! and have the same type of independent variable. + //! \sa Collection + //! \sa Homogeneous + //! \sa Simultaneous class Sequential : public Compound { *************** *** 670,673 **** --- 740,749 ---- }; + //! Class for simultaneous composition of experiments. + //! A simultaneous composition may contain experiments which are dynamic and + //! have the same type and range of the independent variable. + //! \sa Collection + //! \sa Homogeneous + //! \sa Sequential class Simultaneous : public Compound { |