The runtime module API links the GridLAB-D core to modules that are created to perform various modeling tasks. The core interacts with each module according to a set script that determines which exposed module functions are called and when. The general sequence of calls is as follows:
Note that object destruction is not supported at this time.
GridLAB-D modules usually require a number of functions to access data and interaction with the core. These include
Modules | |
| Publishing variables | |
| Modules must register public variables that are accessed by other modules, and the core by publishing them. | |
| Exception handling | |
| Module exception handling is provided for modules implemented in C to perform exception handling, as well to allow C++ code to throw exceptions to the core's main exception handler. | |
| Output functions | |
| Module may output messages to stdout, stderr, and the core test record file using the output functions. | |
| Memory allocation functions | |
| The core is responsible for managing any memory that is shared. | |
| Core access functions | |
| Most module function use core library functions and variables. | |
| Class registration | |
| Class registration is used to make sure the core knows how objects are implemented in modules. | |
| Object management | |
| Object management macros are create to allow modules to create, test, control ranks, and reveal members of objects and registered classes. | |
| Property management | |
| Use the property management functions to provide and gain access to published variables from other modules. | |
| Object search | |
| Searches and navigates object lists. | |
| Random numbers | |
| The random number library provides a variety of random number generations for different distributions. | |
| Time handling functions | |
| Global variables | |
| Locking memory | |
| Memory locking is implemented using compare and exchange methods. | |
| CDECL EXPORT EXTERN CALLBACKS *callback | INIT (NULL) |
| Newton-Raphson branch data pointer array. | |
Defines | |
| #define | PADDR(X) ((char*)&(this->X)-(char*)this) |
| The PUBLISH_ENUM(C,N,E) macro is used to define a keyword for an enumeration variable. | |
| #define PADDR | ( | X | ) | ((char*)&(this->X)-(char*)this) |
The PUBLISH_ENUM(C,N,E) macro is used to define a keyword for an enumeration variable.
The PUBLISH_SET(C,N,E) macro is used to define a keyword for a set variable
Definition at line 161 of file gridlabd.h.
Referenced by capacitor::capacitor(), comm::comm(), house::house(), house_e::house_e(), link::link(), meter::meter(), plc::plc(), substation::substation(), and waterheater::waterheater().
| GLOBAL OBJECT *last_node INIT | ( | NULL | ) |
Newton-Raphson branch data pointer array.
restoration object of the system
Newton-Raphson swing bus.