#include <DataPoint.hpp>
Public Member Functions | |
Constructors and Destructors | |
DataPoint (const UUID &uuid, const UUID &versionUUID, const std::string &name, const std::string &displayName, const std::string &description, const Problem &problem, bool complete, bool failed, bool selected, DataPointRunType runType, const std::vector< QVariant > &variableValues, const std::vector< double > &responseValues, const openstudio::path &directory, const boost::optional< FileReference > &osmInputData, const boost::optional< FileReference > &idfInputData, const boost::optional< FileReference > &sqlOutputData, const boost::optional< runmanager::Job > &topLevelJob, const std::vector< openstudio::path > &dakotaParametersFiles, const std::vector< Tag > &tags, const std::vector< Attribute > &outputAttributes) | |
Constructor provided for deserialization; not for general use. More... | |
DataPoint (const UUID &uuid, const UUID &versionUUID, const std::string &name, const std::string &displayName, const std::string &description, const UUID &problemUUID, const boost::optional< UUID > &analysisUUID, bool complete, bool failed, bool selected, DataPointRunType runType, const std::vector< QVariant > &variableValues, const std::vector< double > &responseValues, const openstudio::path &directory, const boost::optional< FileReference > &osmInputData, const boost::optional< FileReference > &idfInputData, const boost::optional< FileReference > &sqlOutputData, const boost::optional< runmanager::Job > &topLevelJob, const std::vector< openstudio::path > &dakotaParametersFiles, const std::vector< Tag > &tags, const std::vector< Attribute > &outputAttributes) | |
Constructor provided for deserialization; not for general use. More... | |
virtual | ~DataPoint () |
Getters and Queries | |
bool | hasProblem () const |
Returns true if DataPoint has access to the Problem that created it. More... | |
Problem | problem () const |
Returns the Problem used to create/associated with this DataPoint. More... | |
UUID | problemUUID () const |
Returns the UUID of the Problem that created this DataPoint. More... | |
boost::optional< UUID > | analysisUUID () const |
Returns the UUID of the Analysis that parents this DataPoint. More... | |
bool | isComplete () const |
Returns true if the DataPoint has been simulated. More... | |
bool | complete () const |
Returns true if the DataPoint has been simulated. More... | |
bool | failed () const |
Returns true if the DataPoint was simulated, but the simulation failed, or output results could not be retrieved for some other reason. More... | |
bool | selected () const |
Returns true if the DataPoint is selected (to be simulated in the next batch). More... | |
DataPointRunType | runType () const |
std::vector< QVariant > | variableValues () const |
Returns the variableValues to be applied in simulating this DataPoint. More... | |
std::vector< double > | responseValues () const |
Returns the value of the response functions for this DataPoint. More... | |
openstudio::path | directory () const |
Run directory for this DataPoint. More... | |
boost::optional< FileReference > | osmInputData () const |
Returns the final OSM file in the workflow, if the DataPoint isComplete() but not failed(), and said file was located by problem(). More... | |
boost::optional< FileReference > | idfInputData () const |
Returns the final IDF file in the workflow, if the DataPoint isComplete() but not failed(), and said file was located by problem(). More... | |
boost::optional< FileReference > | sqlOutputData () const |
Returns the EnergyPlus SqLite output file, if the DataPoint isComplete() but not failed(), and said file was located by problem(). More... | |
std::vector< FileReference > | xmlOutputData () const |
Returns the openstudio::Attribute and openstudio::result::OSResult XML files created associated with this DataPoint, if complete() and not failed(). More... | |
boost::optional< model::Model > | model () const |
If osmInputData() exists, returns the corresponding model::Model. More... | |
boost::optional< Workspace > | workspace () const |
If idfInputData() exists, returns the corresponding Workspace. More... | |
boost::optional< SqlFile > | sqlFile () const |
If sqlOutputData() exists, returns the corresponding SqlFile, which is also available through model()->sqlFile(), if model() exists. More... | |
std::vector< Attribute > | outputAttributes () const |
If xmlOutputData() exists, returns the corresponding openstudio::Attributes. More... | |
boost::optional< Attribute > | getOutputAttribute (const std::string &attributeName) const |
Returns the outputAttributes() element with attributeName, if it exists. More... | |
std::vector< Tag > | tags () const |
bool | isTag (const std::string &tagName) const |
bool | matches (const std::vector< QVariant > &testVariableValues) const |
Returns true if testVariableValues.size() <= variableValues().size(), and any non-null values match. More... | |
boost::optional< runmanager::Job > | topLevelJob () const |
Returns the top level job associated with this data point. More... | |
std::vector< openstudio::path > | dakotaParametersFiles () const |
Returns vector of dakotaParameterFiles associated with this data point. More... | |
Setters | |
void | setSelected (bool selected) |
void | setRunType (const DataPointRunType &runType) |
void | setDirectory (const openstudio::path &directory) |
Sets the run directory for this DataPoint. More... | |
void | addTag (const std::string &tagName) |
void | deleteTag (const std::string &tagName) |
Actions | |
bool | updateFromJSON (const std::string &json, boost::optional< runmanager::RunManager > &runManager) |
Update high level results from json. More... | |
bool | updateDetails (boost::optional< runmanager::RunManager > &runManager) |
Whoever downloaded the zip file should have setDirectory(), and had the file placed in directory() / toPath("dataPoint.zip"). More... | |
void | clearFileDataFromCache () const |
Clear model, workspace, and sqlFile from cache. More... | |
void | clearAllDataFromCache () const |
Clear model, workspace, sqlFile, and outputAttributes from cache. More... | |
void | clearResults () |
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< AnalysisObject > | parent () 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 > | |
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 | |
DataPoint (const Problem &problem, const std::vector< QVariant > &variableValues) | |
Constructor from variableValues. More... | |
void | markComplete () |
void | markFailed () |
void | setIdfInputData (const FileReference &file) |
void | setOsmInputData (const FileReference &file) |
void | setProblem (const Problem &problem) |
Let Analysis_Impl set the DataPoint's Problem to get a clean clone. More... | |
void | setResponseValues (const std::vector< double > &values) |
void | setSqlOutputData (const FileReference &file) |
void | setXmlOutputData (const std::vector< FileReference > &files) |
Related Functions | |
(Note that these are not member functions.) | |
typedef std::vector< DataPoint > | DataPointVector |
AnalysisJSONLoadResult | loadJSON (const openstudio::path &p) |
Factory method for loading JSON containing an AnalysisObject. More... | |
AnalysisJSONLoadResult | loadJSON (std::istream &json) |
Factory method for loading JSON containing an AnalysisObject. More... | |
AnalysisJSONLoadResult | loadJSON (const std::string &json) |
Factory method for loading JSON containing an AnalysisObject. More... | |
typedef boost::optional < DataPoint > | OptionalDataPoint |
Related Functions inherited from openstudio::analysis::AnalysisObject | |
typedef std::vector < AnalysisObject > | AnalysisObjectVector |
typedef boost::optional < AnalysisObject > | OptionalAnalysisObject |
Serialization | |
bool | saveJSON (const openstudio::path &p, bool overwrite=false) const |
std::ostream & | toJSON (std::ostream &os) const |
std::string | toJSON () const |
static boost::optional< DataPoint > | loadJSON (const openstudio::path &p) |
static boost::optional< DataPoint > | loadJSON (std::istream &json) |
static boost::optional< DataPoint > | loadJSON (const std::string &json) |
DataPoint is an AnalysisObject that describes a single simulation run/to be run for a given Analysis.
New DataPoints are constructed using Problem::createDataPoint, since the DataPoint variableValues only make sense in the context of a Problem. Similarly, results only make sense in the context of an Analysis, where there is a specific Problem and a specific seed file defined. Therefore, once a DataPoint is created, it should be added to an Analysis (Analysis::addDataPoint), and then run using an analysisdriver::AnalysisDriver. In many cases, the createDataPoint and addDataPoint steps are hidden from the user through the use of an Algorithm.
openstudio::analysis::DataPoint::DataPoint | ( | const UUID & | uuid, |
const UUID & | versionUUID, | ||
const std::string & | name, | ||
const std::string & | displayName, | ||
const std::string & | description, | ||
const Problem & | problem, | ||
bool | complete, | ||
bool | failed, | ||
bool | selected, | ||
DataPointRunType | runType, | ||
const std::vector< QVariant > & | variableValues, | ||
const std::vector< double > & | responseValues, | ||
const openstudio::path & | directory, | ||
const boost::optional< FileReference > & | osmInputData, | ||
const boost::optional< FileReference > & | idfInputData, | ||
const boost::optional< FileReference > & | sqlOutputData, | ||
const boost::optional< runmanager::Job > & | topLevelJob, | ||
const std::vector< openstudio::path > & | dakotaParametersFiles, | ||
const std::vector< Tag > & | tags, | ||
const std::vector< Attribute > & | outputAttributes | ||
) |
Constructor provided for deserialization; not for general use.
openstudio::analysis::DataPoint::DataPoint | ( | const UUID & | uuid, |
const UUID & | versionUUID, | ||
const std::string & | name, | ||
const std::string & | displayName, | ||
const std::string & | description, | ||
const UUID & | problemUUID, | ||
const boost::optional< UUID > & | analysisUUID, | ||
bool | complete, | ||
bool | failed, | ||
bool | selected, | ||
DataPointRunType | runType, | ||
const std::vector< QVariant > & | variableValues, | ||
const std::vector< double > & | responseValues, | ||
const openstudio::path & | directory, | ||
const boost::optional< FileReference > & | osmInputData, | ||
const boost::optional< FileReference > & | idfInputData, | ||
const boost::optional< FileReference > & | sqlOutputData, | ||
const boost::optional< runmanager::Job > & | topLevelJob, | ||
const std::vector< openstudio::path > & | dakotaParametersFiles, | ||
const std::vector< Tag > & | tags, | ||
const std::vector< Attribute > & | outputAttributes | ||
) |
Constructor provided for deserialization; not for general use.
|
inlinevirtual |
|
protected |
Constructor from variableValues.
Called by Problem::createDataPoint. After construction complete() == false and selected() == true.
void openstudio::analysis::DataPoint::addTag | ( | const std::string & | tagName | ) |
boost::optional<UUID> openstudio::analysis::DataPoint::analysisUUID | ( | ) | const |
void openstudio::analysis::DataPoint::clearAllDataFromCache | ( | ) | const |
Clear model, workspace, sqlFile, and outputAttributes from cache.
void openstudio::analysis::DataPoint::clearFileDataFromCache | ( | ) | const |
Clear model, workspace, and sqlFile from cache.
void openstudio::analysis::DataPoint::clearResults | ( | ) |
bool openstudio::analysis::DataPoint::complete | ( | ) | const |
Returns true if the DataPoint has been simulated.
std::vector<openstudio::path> openstudio::analysis::DataPoint::dakotaParametersFiles | ( | ) | const |
Returns vector of dakotaParameterFiles associated with this data point.
void openstudio::analysis::DataPoint::deleteTag | ( | const std::string & | tagName | ) |
openstudio::path openstudio::analysis::DataPoint::directory | ( | ) | const |
Run directory for this DataPoint.
Set by analysisdriver::AnalysisDriver.
bool openstudio::analysis::DataPoint::failed | ( | ) | const |
Returns true if the DataPoint was simulated, but the simulation failed, or output results could not be retrieved for some other reason.
boost::optional<Attribute> openstudio::analysis::DataPoint::getOutputAttribute | ( | const std::string & | attributeName | ) | const |
Returns the outputAttributes() element with attributeName, if it exists.
bool openstudio::analysis::DataPoint::hasProblem | ( | ) | const |
boost::optional<FileReference> openstudio::analysis::DataPoint::idfInputData | ( | ) | const |
Returns the final IDF file in the workflow, if the DataPoint isComplete() but not failed(), and said file was located by problem().
bool openstudio::analysis::DataPoint::isComplete | ( | ) | const |
Returns true if the DataPoint has been simulated.
bool openstudio::analysis::DataPoint::isTag | ( | const std::string & | tagName | ) | const |
|
static |
|
static |
|
static |
|
protected |
|
protected |
bool openstudio::analysis::DataPoint::matches | ( | const std::vector< QVariant > & | testVariableValues | ) | const |
Returns true if testVariableValues.size() <= variableValues().size(), and any non-null values match.
Otherwise, returns false.
boost::optional<model::Model> openstudio::analysis::DataPoint::model | ( | ) | const |
If osmInputData() exists, returns the corresponding model::Model.
Also caches the Model for future use.
boost::optional<FileReference> openstudio::analysis::DataPoint::osmInputData | ( | ) | const |
Returns the final OSM file in the workflow, if the DataPoint isComplete() but not failed(), and said file was located by problem().
std::vector<Attribute> openstudio::analysis::DataPoint::outputAttributes | ( | ) | const |
If xmlOutputData() exists, returns the corresponding openstudio::Attributes.
Caches the Attributes for future use.
Problem openstudio::analysis::DataPoint::problem | ( | ) | const |
UUID openstudio::analysis::DataPoint::problemUUID | ( | ) | const |
std::vector<double> openstudio::analysis::DataPoint::responseValues | ( | ) | const |
Returns the value of the response functions for this DataPoint.
Only non-empty if isComplete() and not failed() (and problem().numResponses() > 0).
DataPointRunType openstudio::analysis::DataPoint::runType | ( | ) | const |
bool openstudio::analysis::DataPoint::saveJSON | ( | const openstudio::path & | p, |
bool | overwrite = false |
||
) | const |
bool openstudio::analysis::DataPoint::selected | ( | ) | const |
Returns true if the DataPoint is selected (to be simulated in the next batch).
void openstudio::analysis::DataPoint::setDirectory | ( | const openstudio::path & | directory | ) |
Sets the run directory for this DataPoint.
Generally called by analysisdriver::AnalysisDriver.
|
protected |
|
protected |
|
protected |
|
protected |
void openstudio::analysis::DataPoint::setRunType | ( | const DataPointRunType & | runType | ) |
void openstudio::analysis::DataPoint::setSelected | ( | bool | selected | ) |
|
protected |
|
protected |
boost::optional<SqlFile> openstudio::analysis::DataPoint::sqlFile | ( | ) | const |
If sqlOutputData() exists, returns the corresponding SqlFile, which is also available through model()->sqlFile(), if model() exists.
Also caches the SqlFile for future use.
boost::optional<FileReference> openstudio::analysis::DataPoint::sqlOutputData | ( | ) | const |
Returns the EnergyPlus SqLite output file, if the DataPoint isComplete() but not failed(), and said file was located by problem().
std::vector<Tag> openstudio::analysis::DataPoint::tags | ( | ) | const |
std::ostream& openstudio::analysis::DataPoint::toJSON | ( | std::ostream & | os | ) | const |
std::string openstudio::analysis::DataPoint::toJSON | ( | ) | const |
boost::optional<runmanager::Job> openstudio::analysis::DataPoint::topLevelJob | ( | ) | const |
Returns the top level job associated with this data point.
bool openstudio::analysis::DataPoint::updateDetails | ( | boost::optional< runmanager::RunManager > & | runManager | ) |
Whoever downloaded the zip file should have setDirectory(), and had the file placed in directory() / toPath("dataPoint.zip").
bool openstudio::analysis::DataPoint::updateFromJSON | ( | const std::string & | json, |
boost::optional< runmanager::RunManager > & | runManager | ||
) |
Update high level results from json.
std::vector<QVariant> openstudio::analysis::DataPoint::variableValues | ( | ) | const |
boost::optional<Workspace> openstudio::analysis::DataPoint::workspace | ( | ) | const |
If idfInputData() exists, returns the corresponding Workspace.
Also caches the Workspace for future use.
std::vector<FileReference> openstudio::analysis::DataPoint::xmlOutputData | ( | ) | const |
Returns the openstudio::Attribute and openstudio::result::OSResult XML files created associated with this DataPoint, if complete() and not failed().
Otherwise, the return value is .empty().
|
related |
|
related |
Factory method for loading JSON containing an AnalysisObject.
Returned object will be of the correct type.
|
related |
Factory method for loading JSON containing an AnalysisObject.
Returned object will be of the correct type.
|
related |
Factory method for loading JSON containing an AnalysisObject.
Returned object will be of the correct type.
|
related |