×
Menu
Index

15.5. Accessing Simulation State – Profile Context

Scripted profiles can access the current state of the simulation. For example, a profile may require details of the outside air temperature or the relative humidity in a room.
Access to the simulation state is managed through context objects. Contexts provide a view on to the current state of the simulation, they present a read only interface to the simulation model.
Contexts represent the environment in which the profile is being evaluated. They provide a localised view of the simulation model providing access to useful model quantities and references to related model items.
Each profile instance is guaranteed to have a context and this is assigned to the variable ‘context’ of the profile instance.
There are 3 context types in ApacheSim:
1.     Model
2.     Room
3.     Surface
The profile target defines the type of context assigned to a profile instance.
Room gains and infiltrations are associated with a room and therefore any scripted profiles assigned to these will have a room level context. Room level context are generally the most often encountered in Apache.
 
MacroFlo openings, blinds and shutters are associated with openings and windows. These will be assigned surface level contexts.