![]() |
![]() |
![]() |
cpg-network Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <cpg-network/cpg-monitor.h> CpgMonitor; CpgMonitor * cpg_monitor_new (CpgNetwork *network, CpgObject *object, const gchar *property_name); const gdouble * cpg_monitor_get_sites (CpgMonitor *monitor, guint *size); const gdouble * cpg_monitor_get_data (CpgMonitor *monitor, guint *size); gboolean cpg_monitor_get_data_resampled (CpgMonitor *monitor, const gdouble *sites, guint size, gdouble *ret); CpgObject * cpg_monitor_get_object (CpgMonitor *monitor); CpgProperty * cpg_monitor_get_property (CpgMonitor *monitor);
A CpgMonitor can be used to monitor the value of a certain CpgProperty while simulating. The monitor will collect the value of the property at each simulation step and provides methods to access these values. Particularly useful is cpg_monitor_get_data_resampled which retrieves the data resampled at specific times.
CpgMonitor * cpg_monitor_new (CpgNetwork *network, CpgObject *object, const gchar *property_name);
Create a new monitor for monitoring property property_name
of object
object
in the network network
. The monitor will attach itself to the
life time of the network and object.
|
a CpgNetwork |
|
a CpgObject |
|
a property name |
Returns : |
a new CpgMonitor |
const gdouble * cpg_monitor_get_sites (CpgMonitor *monitor, guint *size);
Returns the data sites as monitored during the simulation. See also cpg_monitor_get_data_resampled for retrieving a resampled version of the monitor data
|
a CpgMonitor |
|
return value for number of values |
Returns : |
internal array of monitored sites. The pointer should not be freed |
const gdouble * cpg_monitor_get_data (CpgMonitor *monitor, guint *size);
Returns the data as monitored during the simulation. See also cpg_monitor_get_data_resampled for retrieving a resampled version of the monitor data
|
a CpgMonitor |
|
return value for number of values |
Returns : |
internal array of monitored values. The pointer should not be freed |
gboolean cpg_monitor_get_data_resampled (CpgMonitor *monitor, const gdouble *sites, guint size, gdouble *ret);
Returns the data as monitored during the simulation, but resampled at
specific data sites. ret
will have to be already allocated and large
enough to hold size
values.
|
a CpgMonitor |
|
the data sites at which to resample the data |
|
the size of the data sites array |
|
the return location for the resampled data |
Returns : |
TRUE if ret was successfully filled with data, FALSE otherwise
|
CpgObject * cpg_monitor_get_object (CpgMonitor *monitor);
Returns the object from which a property is being monitored.
|
a CpgMonitor |
Returns : |
a pointer to the CpgObject |
CpgProperty * cpg_monitor_get_property (CpgMonitor *monitor);
Returns the property which is being monitored.
|
a CpgMonitor |
Returns : |
a pointer to the CpgProperty |