OMSimulatorLib
The OMSimulator project is a FMI-based co-simulation environment that supports ordinary (i.e., non-delayed) and TLM connections.
|
#include <Model.h>
Public Member Functions | |
~Model () | |
const ComRef & | getCref () const |
System * | getSystem (const ComRef &cref) |
oms_status_enu_t | delete_ (const ComRef &cref) |
Component * | getComponent (const ComRef &cref) |
System * | getTopLevelSystem () const |
std::string | getTempDirectory () const |
oms_status_enu_t | rename (const ComRef &cref) |
oms_status_enu_t | rename (const ComRef &cref, const ComRef &newCref) |
oms_status_enu_t | list (const ComRef &cref, char **contents) |
oms_status_enu_t | listVariants (const ComRef &cref, char **contents) |
oms_status_enu_t | addSystem (const ComRef &cref, oms_system_enu_t type) |
oms_status_enu_t | newResources (const ComRef &cref) |
oms_status_enu_t | addResources (const ComRef &cref, const std::string &path) |
oms_status_enu_t | deleteReferencesInSSD (const ComRef &cref) |
oms_status_enu_t | deleteResourcesInSSP (const std::string &filename) |
oms_status_enu_t | duplicateVariant (const ComRef &crefA, const ComRef &crefB) |
oms_status_enu_t | activateVariant (const ComRef &crefA, const ComRef &crefB) |
oms_status_enu_t | referenceResources (const ComRef &cref, const std::string &ssmFile) |
oms_status_enu_t | reduceSSV (const std::string &ssvfile, const std::string &ssmfile, const std::string &filepath) |
oms_status_enu_t | exportToSSD (Snapshot &snapshot) const |
oms_status_enu_t | exportSnapshot (const ComRef &cref, char **contents) |
oms_status_enu_t | exportSSVTemplate (const ComRef &cref, const std::string &filename) |
oms_status_enu_t | exportSSMTemplate (const ComRef &cref, const std::string &filename) |
void | exportSignalFilter (Snapshot &snapshot) const |
void | exportUnitDefinitionsToSSD (pugi::xml_node &node) const |
void | exportEnumerationDefinitionsToSSD (pugi::xml_node &node) const |
oms_status_enu_t | importFromSnapshot (const Snapshot &snapshot) |
oms_status_enu_t | importSnapshot (const char *snapshot, char **newCref) |
oms_status_enu_t | importSignalFilter (const std::string &filename, const Snapshot &snapshot) |
oms_status_enu_t | exportToFile (const std::string &filename) const |
oms_system_enu_t | getSystemType (const pugi::xml_node &node, const std::string &sspVersion) |
oms_system_enu_t | getSystemTypeHelper (const pugi::xml_node &node, const std::string &sspVersion) |
oms_status_enu_t | updateParameterBindingsToSSD (pugi::xml_node &node, bool isTopSystemOrModel) const |
void | copyResources (bool copy_resources) |
bool | copyResources () |
oms::Element ** | getElements () |
void | writeAllResourcesToFilesystem (std::vector< std::string > &resources, Snapshot &snapshot) const |
oms_status_enu_t | instantiate () |
oms_status_enu_t | initialize () |
oms_status_enu_t | simulate () |
oms_status_enu_t | doStep () |
oms_status_enu_t | stepUntil (double stopTime) |
oms_status_enu_t | terminate () |
oms_status_enu_t | reset () |
oms_modelState_enu_t | getModelState () const |
oms_status_enu_t | setStartTime (double value) |
double | getStartTime () const |
oms_status_enu_t | setStopTime (double value) |
double | getStopTime () const |
double | getTime () const |
oms_status_enu_t | setLoggingInterval (double loggingInterval) |
double | getLoggingInterval () const |
oms_status_enu_t | setResultFile (const std::string &filename, int bufferSize) |
oms_status_enu_t | getResultFile (char **filename, int *bufferSize) |
oms_status_enu_t | emit (double time, bool force=false, bool *emitted=NULL) |
oms_status_enu_t | addSignalsToResults (const char *regex) |
oms_status_enu_t | removeSignalsFromResults (const char *regex) |
bool | validState (int validStates) const |
bool | isIsolatedFMUModel () const |
void | setIsolatedFMUModel () |
bool | useThreadPool () |
ctpl::thread_pool & | getThreadPool () |
oms_status_enu_t | loadSnapshot (const pugi::xml_node &node) |
std::string | getVariantName () |
Static Public Member Functions | |
static Model * | NewModel (const ComRef &cref) |
Public Attributes | |
std::vector< std::string > | importedResources |
list of imported resources from ssp More... | |
std::map< ComRef, char * > | ssdVariants |
list of all variants copied when user create a new variant using oms_duplicateVariant() More... | |
Private Member Functions | |
Model (const ComRef &cref, const std::string &tempDir) | |
Model (Model const ©) | |
not implemented More... | |
Model & | operator= (Model const ©) |
not implemented More... | |
oms_status_enu_t | registerSignalsForResultFile () |
Private Attributes | |
ComRef | cref |
System * | system = NULL |
std::string | tempDir |
std::vector< oms::Element * > | elements |
bool | copy_resources = true |
oms_modelState_enu_t | modelState = oms_modelState_virgin |
double | startTime = 0.0 |
double | stopTime = 1.0 |
ResultWriter * | resultFile = NULL |
double | lastEmit |
double | loggingInterval = 0.0 |
int | bufferSize = 10 |
Clock | clock |
Values | values |
std::string | resultFilename |
default <name>_res.mat More... | |
std::string | signalFilterFilename = "resources/signalFilter.xml" |
std::string | variantName = "SystemStructure.ssd" |
default name More... | |
std::vector< std::string > | externalResources |
list of external ssv or ssm resources from filesystem More... | |
bool | isolatedFMU = false |
ctpl::thread_pool * | pool = nullptr |
ComRef | new_root_cref |
oms::Model::~Model | ( | ) |
|
private |
|
private |
not implemented
oms_status_enu_t oms::Model::addResources | ( | const ComRef & | cref, |
const std::string & | path | ||
) |
oms_status_enu_t oms::Model::addSignalsToResults | ( | const char * | regex | ) |
oms_status_enu_t oms::Model::addSystem | ( | const ComRef & | cref, |
oms_system_enu_t | type | ||
) |
|
inline |
|
inline |
oms_status_enu_t oms::Model::delete_ | ( | const ComRef & | cref | ) |
oms_status_enu_t oms::Model::deleteReferencesInSSD | ( | const ComRef & | cref | ) |
oms_status_enu_t oms::Model::deleteResourcesInSSP | ( | const std::string & | filename | ) |
oms_status_enu_t oms::Model::doStep | ( | ) |
oms_status_enu_t oms::Model::emit | ( | double | time, |
bool | force = false , |
||
bool * | emitted = NULL |
||
) |
void oms::Model::exportEnumerationDefinitionsToSSD | ( | pugi::xml_node & | node | ) | const |
void oms::Model::exportSignalFilter | ( | Snapshot & | snapshot | ) | const |
oms_status_enu_t oms::Model::exportSnapshot | ( | const ComRef & | cref, |
char ** | contents | ||
) |
oms_status_enu_t oms::Model::exportSSMTemplate | ( | const ComRef & | cref, |
const std::string & | filename | ||
) |
oms_status_enu_t oms::Model::exportSSVTemplate | ( | const ComRef & | cref, |
const std::string & | filename | ||
) |
oms_status_enu_t oms::Model::exportToFile | ( | const std::string & | filename | ) | const |
oms_status_enu_t oms::Model::exportToSSD | ( | Snapshot & | snapshot | ) | const |
void oms::Model::exportUnitDefinitionsToSSD | ( | pugi::xml_node & | node | ) | const |
oms::Component * oms::Model::getComponent | ( | const ComRef & | cref | ) |
|
inline |
|
inline |
|
inline |
|
inline |
oms_status_enu_t oms::Model::getResultFile | ( | char ** | filename, |
int * | bufferSize | ||
) |
|
inline |
|
inline |
oms::System * oms::Model::getSystem | ( | const ComRef & | cref | ) |
oms_system_enu_t oms::Model::getSystemType | ( | const pugi::xml_node & | node, |
const std::string & | sspVersion | ||
) |
oms_system_enu_t oms::Model::getSystemTypeHelper | ( | const pugi::xml_node & | node, |
const std::string & | sspVersion | ||
) |
|
inline |
|
inline |
double oms::Model::getTime | ( | ) | const |
|
inline |
|
inline |
oms_status_enu_t oms::Model::importFromSnapshot | ( | const Snapshot & | snapshot | ) |
oms_status_enu_t oms::Model::importSignalFilter | ( | const std::string & | filename, |
const Snapshot & | snapshot | ||
) |
oms_status_enu_t oms::Model::importSnapshot | ( | const char * | snapshot, |
char ** | newCref | ||
) |
oms_status_enu_t oms::Model::initialize | ( | ) |
oms_status_enu_t oms::Model::instantiate | ( | ) |
|
inline |
oms_status_enu_t oms::Model::list | ( | const ComRef & | cref, |
char ** | contents | ||
) |
oms_status_enu_t oms::Model::listVariants | ( | const ComRef & | cref, |
char ** | contents | ||
) |
oms_status_enu_t oms::Model::loadSnapshot | ( | const pugi::xml_node & | node | ) |
|
static |
NewModel() is used instead of a constructor to make sure that only instances with valid names can be created.
oms_status_enu_t oms::Model::newResources | ( | const ComRef & | cref | ) |
oms_status_enu_t oms::Model::reduceSSV | ( | const std::string & | ssvfile, |
const std::string & | ssmfile, | ||
const std::string & | filepath | ||
) |
oms_status_enu_t oms::Model::referenceResources | ( | const ComRef & | cref, |
const std::string & | ssmFile | ||
) |
|
private |
oms_status_enu_t oms::Model::removeSignalsFromResults | ( | const char * | regex | ) |
oms_status_enu_t oms::Model::rename | ( | const ComRef & | cref | ) |
oms_status_enu_t oms::Model::reset | ( | ) |
|
inline |
oms_status_enu_t oms::Model::setLoggingInterval | ( | double | loggingInterval | ) |
oms_status_enu_t oms::Model::setResultFile | ( | const std::string & | filename, |
int | bufferSize | ||
) |
oms_status_enu_t oms::Model::setStartTime | ( | double | value | ) |
oms_status_enu_t oms::Model::setStopTime | ( | double | value | ) |
oms_status_enu_t oms::Model::simulate | ( | ) |
oms_status_enu_t oms::Model::stepUntil | ( | double | stopTime | ) |
oms_status_enu_t oms::Model::terminate | ( | ) |
oms_status_enu_t oms::Model::updateParameterBindingsToSSD | ( | pugi::xml_node & | node, |
bool | isTopSystemOrModel | ||
) | const |
|
inline |
|
inline |
void oms::Model::writeAllResourcesToFilesystem | ( | std::vector< std::string > & | resources, |
Snapshot & | snapshot | ||
) | const |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
list of external ssv or ssm resources from filesystem
std::vector<std::string> oms::Model::importedResources |
list of imported resources from ssp
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
default <name>_res.mat
|
private |
std::map<ComRef, char*> oms::Model::ssdVariants |
list of all variants copied when user create a new variant using oms_duplicateVariant()
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
default name