42.3 System Environment/Global Trackers
This section continues to examine the Healthcare tutorial example tree, Parallel Trials - Queue - GlobalTracker.trex. Specifically, this section describes the use of Global Trackers to control access to the limited treatment resource.
Global Trackers are used to control the model at a system level - affecting all patients within the system for that particular strategy. This is quite different from regular Trackers which are associated with each specific patient within a strategy. Global Trackers are useful for storing values which need to be accessed and updated by all the trials in the model. They can be read and or updated by any patient at any node in the model.
In this example model, Global Trackers are used to store the number of available treatment resources. The Global Tracker gt_AvailableResources is defined on the Global Trackers View. This View has similar tools to other Views available in TreeAge Pro. When you create a new Global Tracker, you can edit the initial value via the Add/Change dialogue as in the figure below.
In this instance, we set the initial value of the gt_AvailableResources to 0 for each strategy. We will need to set the proper number of resources to 2 and 3 for the top and bottom strategies, respectively.
The Add/Change dialgoue also allows modifications and ranking report values to be shown or hidden by selecting the check box.
For Global Trackers, there are three commands we can use to change their value as listed in the table below.
Command | Description |
---|---|
GlobalTrkGet("gt_Name") |
Retrieves the current value of global tracker gt_Name. |
GlobalTrkSet("gt_Name"; value) |
Sets the global tracker gt_Name equal to value. |
GlobalTrkIncr("gt_Name"; increment) |
Increments the global tracker gt_Name by increment. Note that increment can be positive or negative. |
Note that when a Global Tracker is updated with the second or third function above, you will need a place to enter that into the model. Typically, this can be done through a tracker modification. In this example model, t_action is used to update the Global Tracker. We don't care about the value of t_action, but we will use this tracker to execute the Global Tracker updates.
We can now look at how the Global Tracker is used within the model in conjunction with the Stop node. There are three distinct places where these values need to change within the example model.
Node | Syntax | Result |
---|---|---|
Markov node tracker modification |
t_action = if(_trial=1; GlobalTrkSet("gt_AvailableResources"; N_resources_total); 0) |
Sets the number of available resources for each strategy. |
Waiting for Resource logical expression |
GlobalTrkGet("gt_AvailableResources") > 0 |
Check for whether a resource is available. |
Get Resource tracker modification |
t_action = GlobalTrkIncr("gt_AvailableResources"; -1) |
When resource is taken, decrement available resources by 1. |
Release Resource tracker modification |
t_action = GlobalTrkIncr("gt_AvailableResources"; 1) |
When resource is released, increment available resources by 1. |
We know that patients currently holding the resource will have the opportunity to release it before patients request the resource because the waiting patients halt mid-cycle at a Stop node.
Let's consider two trials waiting at the Stop node below, where only one resource is available. Note that this would work the same for either Stop node.
-
Trial 1 sees the available resource because GlobalTrkGet("gt_AvailableResources") > 0 returns true when there is a resource available.
-
Trial 1 proceeds to the GetResource node.
-
Trial 1 executes the tracker modification t_action = GlobalTrkIncr("gt_AvailableResources"; -1), which reduces the number of available resources to 0.
-
Trial 2 sees no available resource because GlobalTrkGet("gt_AvailableResources") > 0 returns false.
-
Trial 2 proceeds to the Wait for Available Resource node, and continues to wait for the resource into the next cycle.
The Global Tracker gt_AvailableResources is incremented when trials have finished with treatment as highlighted in the figure below. This can happen when they finish treatment or die.
Now that we have studied the model structure including Stop Nodes and Global Trackers, we can analyze the model.