OpenStudioCore:analysis
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Protected Member Functions | Related Functions | List of all members
openstudio::analysis::Algorithm Class Reference

#include <Algorithm.hpp>

+ Inheritance diagram for openstudio::analysis::Algorithm:

Public Member Functions

Constructors and Destructors
virtual ~Algorithm ()
 
Getters and Queries
bool isComplete () const
 Returns true if the Algorithm ran to completion. More...
 
bool failed () const
 Returns true if the Algorithm ran to completion, but failed in some way. More...
 
int iter () const
 Returns the iteration number, which is incremented during the process of running an Analysis. More...
 
AlgorithmOptions options () const
 AlgorithmOptions shares its data on assignment and copy construction. More...
 
bool isCompatibleProblemType (const Problem &problem) const
 Returns true if Algorithm can operate on problem. More...
 
- Public Member Functions inherited from openstudio::analysis::AnalysisObject
virtual ~AnalysisObject ()
 
AnalysisObject clone () const
 Deep copy. More...
 
std::string name () const
 
std::string displayName () const
 
std::string description () const
 
openstudio::UUID uuid () const
 
openstudio::UUID versionUUID () const
 
bool isDirty () const
 Returns true if this object has been changed since its dirty flag was last cleared. More...
 
bool operator== (const AnalysisObject &other) const
 Compare impls. More...
 
bool operator!= (const AnalysisObject &other) const
 
bool uuidEqual (const AnalysisObject &other) const
 
bool uuidAndVersionEqual (const AnalysisObject &other) const
 
boost::optional< AnalysisObjectparent () const
 
void setName (const std::string &newName)
 
void setDisplayName (const std::string &newDisplayName)
 
void setDescription (const std::string &newDescription)
 
bool clearDirtyFlag ()
 Call this method to reset the dirty flag of this object and all its children. More...
 
bool connect (const char *signal, const QObject *receiver, const char *slot, Qt::ConnectionType type=Qt::AutoConnection) const
 Connect signal from this AnalysisObject to slot on receiver. More...
 
bool disconnect (const char *signal=nullptr, const QObject *receiver=nullptr, const char *slot=nullptr) const
 
template<typename T >
cast () const
 Cast to type T. More...
 
template<typename T >
boost::optional< T > optionalCast () const
 Cast to boost::optional<T>. More...
 

Protected Member Functions

void reset ()
 Resets algorithm back to its initial state. More...
 
void resetComplete ()
 

Related Functions

(Note that these are not member functions.)

typedef std::vector< AlgorithmAlgorithmVector
 
typedef boost::optional
< Algorithm
OptionalAlgorithm
 

Detailed Description

Algorithm is an abstract AnalysisObject that is the base class for all OpenStudioAlgorithms and DakotaAlgorithms.

The primary job of an Algorithm is to maintain its iteration count and its AlgorithmOptions, and determine whether it is applicable to a given Problem.

Constructor & Destructor Documentation

virtual openstudio::analysis::Algorithm::~Algorithm ( )
inlinevirtual

Member Function Documentation

bool openstudio::analysis::Algorithm::failed ( ) const

Returns true if the Algorithm ran to completion, but failed in some way.

Perhaps not all simulations completed successfully, or output results could not be retrieved for some other reason.

bool openstudio::analysis::Algorithm::isCompatibleProblemType ( const Problem problem) const

Returns true if Algorithm can operate on problem.

For example, DesignOfExperiments can work on Problems for which allVariablesAreDiscrete, and SequentialSearch requires an OptimizationProblem with two objective functions and allVariablesAreDiscrete.

bool openstudio::analysis::Algorithm::isComplete ( ) const

Returns true if the Algorithm ran to completion.

int openstudio::analysis::Algorithm::iter ( ) const

Returns the iteration number, which is incremented during the process of running an Analysis.

After construction, iter() == -1. If an algorithm runs the baseline point before doing anything else, that iteration is iter 0. Otherwise, iter 1, 2, etc. are used.

AlgorithmOptions openstudio::analysis::Algorithm::options ( ) const

AlgorithmOptions shares its data on assignment and copy construction.

Therefore, .options().setMaxIter(3) would set the maximum number of iterations for this Algorithm object to 3. (There is no need for a .setOptions(const AlgorithmOptions&) method.)

void openstudio::analysis::Algorithm::reset ( )
protected

Resets algorithm back to its initial state.

Called by Analysis when results are cleared.

void openstudio::analysis::Algorithm::resetComplete ( )
protected

Friends And Related Function Documentation

typedef std::vector<Algorithm> AlgorithmVector
related
typedef boost::optional<Algorithm> OptionalAlgorithm
related