State API

class state.StateManager(api: <ctypes.LibraryLoader object at 0x7f6d531e5c90>)[source]

Bases: object

This API class enables a client to create and manage state instances for using EnergyPlus API methods. Nearly all EnergyPlus API methods require a state object to be passed in, and when callbacks are made, the current state is passed as the only argument. This allows client code to close the loop and pass the current state when making API calls inside callbacks.

The state object is at the heart of accessing EnergyPlus via API, however, the client code should simply be a courier of this object, and never attempt to manipulate the object. State manipulation occurs inside EnergyPlus, and attempting to modify it manually will likely not end well for the workflow.

This class allows a client to create a new state, reset it, and free the object when finished with it.

delete_state(state: c_void_p) None[source]

This function deletes an existing state instance, freeing the memory.

Returns:

Nothing

new_state() c_void_p[source]

This function creates a new state object that is required to pass into EnergyPlus Runtime API function calls

Returns:

A pointer to a new state object in memory

reset_state(state: c_void_p) None[source]

This function resets an existing state instance, thus resetting the simulation, including any registered callback functions.

Returns:

Nothing