vcStatistics
vcStatistics allows you to create flow type and state based statistics as well as access the properties of a Statistics behavior and related simulation statistics.
Inherits: vcBehaviour
Properties
The values of a Statistics behavior's properties depend on the amount of behaviors referencing the Statistics behavior. That is, a Statistics behavior is capable of collecting data from more than one container, path or executor to result in cumulative data. In some cases, a component may use more than one Statistics behavior, thereby the data of those objects are compared to yield results. Generally, a component has only one Statistics behavior, so collected data represents the whole component.
Name | Type | Access | Description |
ComponentMaxCount | Integer | R | Gets the maximum number of components that have been contained in a component at any given time. |
ComponentMaxTime | Real | R | Gets the maximum amount of time a component spent contained in a component. |
ComponentMinCount | Integer | R | Gets the minimum number of components that been contained in a component at any given time. |
ComponentMinTime | Real | R | Gets the minimum amount of time a component spent contained in a component. |
ComponentsArrived | Integer | R | Gets the total number of components that have been transferred into a component. |
ComponentsAverageTime | Real | R | Gets the average amount of time components have spent in a component. |
ComponentsCurrent | Integer | R | Gets the total number of components currently contained in a component. |
ComponentsDeparted | Integer | R | Gets the total amount of components that have been transferred out of a component. |
Name | String | RW | Defines the name of Statistics behavior. |
States | List of n-tuple (String state_name, Enumeration system_state_type) | RW | Defines a list of defined states mapped to system states.
A state must be mapped to a system state. See Statistics for more information. |
SystemStates | List of n-tuple (String system_state_description, Enumeration system_state_type) | R | Gets a list of available system states, which provides system state description and type.
See Statistics Constants for more information. |
Flow type properties
During a simulation, a vcFlow object can update flow type statistics automatically if that object's Statistics property references a vcStatistics object. Flow type statistics can be controlled manually by using flowEnter() and flowLeave() methods.
The following properties are cumulative and based on total simulation runtime.
Name | Type | Access | Description |
PartsAverageCount | Real | R | Gets the average amount of components that have been contained in a component. |
PartsAverageTime | Real | R | Gets the average amount of time components spent in a component. |
PartsCurrent | Integer | R | Gets the current amount of components contained in a component. |
PartsEntered | Integer | RW | Gets/Sets the number of components that have been transferred into a component.
Generally, this property is set to reset a count or collect from the start of a new process. |
PartsExited | Integer | RW | Gets/Sets the number of components that have been transferred out of a component.
Generally, this property is set to reset a count or collect from the start of a new process. |
PartsMaxCount | Integer | R | Gets the maximum number of components that have been contained in a component at any given time. |
PartsMaxTime | Real | R | Gets the maximum amount of time a component has spent in a component. |
PartsMinCount | Integer | R | Gets the minimum number of components that have been contained in a component at any given time. |
PartsMinTime | Real | R | Gets the minimum amount of time a component has spent in a component. |
PartsTotalTime | Real | R | Gets sum total of the amount of time each component had spent in a component, for example the duration of each component on a conveyor added together. |
PartsUtilization | Real | R | Gets the percentage of a component's capacity being utilized: number of parts divided by component's capacity. |
The following properties are based on the last recorded interval of a simulation.
Name | Type | Access | Description |
PartsIntervalAverageCount | Real | R | Same as other flow type properties, yet each value reflects the last recorded interval during a simulation, which by default is every 60.0 seconds. See vcStatisticsManager for more information on how to change interval. |
PartsIntervalAverageTime | Real | R | |
PartsIntervalCurrent | Integer | R | |
PartsIntervalEntered | Integer | R | |
PartsIntervalExited | Integer | R | |
PartsIntervalMaxCount | Integer | R | |
PartsIntervalMaxTime | Real | R | |
PartsIntervalMinCount | Integer | R | |
PartsIntervalMinTime | Real | R | |
PartsIntervalTotalTime | Real | R | |
PartsIntervalUtilization | Real | R |
State based properties
State based statistics are controlled by setting an object's State property to a different state. Therefore, a Statistics behavior would need to have defined states.
The following properties are cumulative and based on total simulation runtime.
Name | Type | Access | Properties |
AverageActivePeriodTime | Real | R | Gets the average amount of time a component was in one of its defined states. |
BlockedPercentage | Real | R | Gets the amount of time a component spent in a blocked state, for example capacity issue, as a percentage of total time. |
BreakPercentage | Real | R | Gets the amount of time a component spent in a broken state as a percentage of total time. |
BusyPercentage | Real | R | Gets the amount of time a component spent in a busy state or was being used as a percentage of total time. |
FailedPercentage | Real | R | Gets the amount of time a component spent in a failed state as a percentage of total time. |
IdlePercentage | Real | R | Gets the amount of time a component spent in an idle state as a percentage of total time. |
RepairPercentage | Real | R | Gets the amount of time a component spent in a repair state as a percentage of total time.
Scripting can be used to set repair time and include time waiting for a repair. |
SetupPercentage | Real | R | Gets the amount of time a component spent in a setup state, for example warm up time, as a percentage of total time. |
State | String | RW | Defines the current state of component.
Use the States property to get an indication of available states in component. |
State<name>Percentage | Real | R | Gets the amount of time a component spent in a user-defined state as a percentage of total time.
For example, StateExamplePercentage would refer to defined state called Example. |
TotalStateTime | Real | R | Gets the total amount of time a component was in one of its defined states based on total time. |
Utilization | Real | R | Gets the amount of time a component was busy during a simulation as a percentage (busy state/100 * 100%). |
The following properties are based on the last recorded interval of a simulation.
Name | Type | Access | Description |
IntervalBlockedPercentage | Real | R | Same as other state based properties, yet each value reflects the last recorded interval during a simulation, which by default is every 60.0 seconds.
See vcStatisticsManager for more information on how to change interval. |
IntervalBreakPercentage | Real | R | |
IntervalBusyPercentage | Real | R | |
IntervalFailedPercentage | Real | R | |
IntervalIdlePercentage | Real | R | |
IntervalRepairPercentage | Real | R | |
IntervalSetupPercentage | Real | R | |
IntervalTotalStateTime | Real | R | |
IntervalUtilization | Real | R | |
State<name>IntervalPercentage | Real | R |
Methods
Name | Return Type | Parameters | Description |
flowEnter | None | vcComponent component | Manually records a given component transferring into component. |
flowLeave | None | vcComponent component | Manually records a given component transferring out of component. |
getIntervalPercentage | Real | String state | Returns the accumulated time of a given state as a percentage of the last recorded interval during a simulation. |
getPercentage | Real | String state | Returns the accumulated time of a given state as a percentage of total time at the time of call. |
getSystemIntervalPercentage | Real | Enumeration system_state | Returns the accumulated time of a given system_state as a percentage of the last recorded interval during a simulation. |
getSystemPercentage | Real | Enumeration system_state | Returns the accumulated time of a given system_state as a percentage of total time at the time of call. |
getSystemTime | Real | Enumeration system_state | Returns the accumulated time of a given system_state at the time of call. |
getTime | Real | String state | Returns the accumulated time of a given state at the time of call. |
warmupCompleted | None | None | Marks the completion/end of a component's warm up period, thereby setting all statistics to zero at the time of call.
For example, a component can be configured to run a delay or a certain number of time consuming tasks at the start of a simulation. When this method is called, warm up time is calculated from simulation start to time of call. |
Events
Name | Parameters | Description |
OnFlowChange | vcStatistics statistics, Real time, Boolean incoming, vcNode component | Triggered when a component is transferred into or out of a component.
The statistics argument is the Statistics behavior that recorded the event. The time argument is simulation time when flow change occurred. The incoming argument is True when component transfers in and False when component transfers out of component. |
OnStateChange | vcStatistics statistics, Real time, Integer state, vcNode component | Triggered when the state change occurs in a component.
The statistics argument is the Statistics behavior that recorded the event. The time argument is simulation time when state change occurred. The state argument is the new state or system state of component. Refer to States or SystemStates property values as needed. |
Examples
Example. Print statistical properties and values
from vcScript import * comp = getComponent() statistics = comp.findBehaviour('Statistics') #create loop for i in statistics.Properties: print i.Name, i.Value |