VPTissue Reference Manual
ParameterExploration.h
Go to the documentation of this file.
1 #ifndef SIMPT_PAREX_PARAMETER_EXPLORATION_H_
2 #define SIMPT_PAREX_PARAMETER_EXPLORATION_H_
3 /*
4  * Copyright 2011-2016 Universiteit Antwerpen
5  *
6  * Licensed under the EUPL, Version 1.1 or as soon they will be approved by
7  * the European Commission - subsequent versions of the EUPL (the "Licence");
8  * You may not use this work except in compliance with the Licence.
9  * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl5
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the Licence is distributed on an "AS IS" basis,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the Licence for the specific language governing
15  * permissions and limitations under the Licence.
16  */
22 #include "Exploration.h"
23 
24 #include <utility>
25 
26 namespace SimPT_Parex {
27 
28 class ISweep;
29 
34 {
35 public:
42  ParameterExploration(const std::string& name, const boost::property_tree::ptree& original,
43  const boost::property_tree::ptree& preferences);
44 
50  ParameterExploration(const boost::property_tree::ptree& pt);
51 
56 
61 
65  virtual ~ParameterExploration();
66 
70  virtual ParameterExploration* Clone() const;
71 
75  virtual std::vector<std::string> GetParameters() const;
76 
83  virtual std::vector<std::string> GetValues(unsigned int index) const;
84 
88  virtual unsigned int GetNumberOfTasks() const;
89 
94  virtual SimTask* CreateTask(unsigned int index) const;
95 
99  virtual std::vector<std::string> GetPossibleParameters() const;
100 
108  std::string GetOriginalValue(const std::string& parameter) const;
109 
114  const ISweep* GetSweep(const std::string& parameter) const;
115 
119  const std::list<std::pair<std::string, ISweep*>>& GetSweeps() const { return m_sweeps; }
120 
125  void SetSweep(const std::string& parameter, ISweep* sweep);
126 
130  void RemoveSweep(const std::string& parameter);
131 
132 
148  virtual boost::property_tree::ptree ToPtree() const;
149 
150 private:
156  virtual void ReadPtree(const boost::property_tree::ptree& pt);
157 
158 private:
159  boost::property_tree::ptree m_original;
160  std::list<std::pair<std::string, ISweep*>> m_sweeps;
161 };
162 
163 } // namespace
164 
165 #endif // end-of-include-guard
virtual std::vector< std::string > GetPossibleParameters() const
Returns all the possible parameters for the exploration.
Interface for Exploration.
virtual unsigned int GetNumberOfTasks() const
Returns the number of tasks the exploration currently contains.
const ISweep * GetSweep(const std::string &parameter) const
Returns the sweep associated with the given parameter.
ParameterExploration(const std::string &name, const boost::property_tree::ptree &original, const boost::property_tree::ptree &preferences)
Constructor.
An interface class for a parameter sweep.
Definition: ISweep.h:31
virtual std::vector< std::string > GetParameters() const
Returns all the parameters in the exploration.
virtual boost::property_tree::ptree ToPtree() const
Convert the exploration to a ptree.
void SetSweep(const std::string &parameter, ISweep *sweep)
Set a sweep for the given parameter.
virtual std::vector< std::string > GetValues(unsigned int index) const
Return the values of a certain task.
ParameterExploration & operator=(const ParameterExploration &other)
Assignment operator.
Namespace for SimPT parameter explorer package.
Definition: Client.cpp:52
virtual SimTask * CreateTask(unsigned int index) const
Creates a task with the parameters on the given index.
const std::list< std::pair< std::string, ISweep * > > & GetSweeps() const
Returns all the sweeps.
Contains all information needed for a transmitable simulation task.
Definition: SimTask.h:31
std::string GetOriginalValue(const std::string &parameter) const
Returns the original value of the parameter.
Class describing a parameter exploration and its simulation tasks.
Class describing a generic exploration.
Definition: Exploration.h:33
void RemoveSweep(const std::string &parameter)
Removes the sweep (if any) for the given parameter.
virtual ParameterExploration * Clone() const
Clone function.