Modeling How-To's > Modeling Activities > Percentage-Based Activities

Percentage-Based Activities (when there are only two percentage options)

For a given activity, a different activity time or activity action should occur a certain percentage of the time.

 

The model used for this example, as well as all of the modeling "how-to" examples, can be found in the ProModel Solutions Café (http://www.promodel.com/solutionscafe/howto/). A video demonstrating this solution can be found here.

Solution A

  1. Click on the Logic button in the activity Properties dialog.
  2. Define an IF statement to test whether the system function Rand(100) is less than or equal to the percentage value of interest. (The Rand(100) function returns a random value between 0 and 100.)
  3. Define a WAIT statement (or other action statement) that applies when this percentage value is met.
  4. Define an alternative ELSE and an associated WAIT statement (or other action statement) for the remaining percentage option.
Example

20% of those who get a flu vaccination at a certain health facility also get a pneumonia vaccination at the same time. It takes only 1 minute to get a flu vaccination but 2 minutes if both are obtained.

Solution

The Logic Builder for the Vaccination activity tests for the Rand(100) function to be less than or equal to 80 and is followed by a 1 minute WAIT time. This is followed by an ELSE statement to catch the remaining 20% of the patients who get both vaccinations and therefore take 2 minutes.

Percentage-based Activities (when there are more than two percentage options)

The activity time is based on one of several percentage options or percentages of total entries.

Solution B (Note that this solution tests on the cumulative percentages of interest)

  1. Click on the Logic button in the activity Properties dialog.
  2. Define a Local Variable giving it a name and selecting Real for its type.
  3. Define an Assign statement assigning the Rand(100) function to the local variable. This assigns a random number between 0 and 100 to the local variable. You will be comparing this value to the percentage value of interest expressed as a cumulative percentage value.
  4. Define an IF statement to test whether the local variable is less than or equal to the first percentage value of interest.
  5. Define a WAIT statement or other desired Action statement for the percentage value being tested.

  6. Define ELSE IF statements and associated tests for the local variable being less than or equal to the cumulative percentage value of each remaining percentage test.

  7. Define a WAIT (or other) statement for each of the above ELSE IF statements.

Example

Calls coming into a call center Support activity take different times depending on the nature of the problem. The four basic classes of problems and their percentage of occurrence are as follows: simple (30%), moderate (40%), difficult (20%) and very difficult (10%). Simple problems take .5 minutes, moderate problems 1.5 minutes, difficult problems 5 minutes and very difficult problems 15 minutes.

Solution

The Logic Builder for the Support activity shows a local variable called vProblem that is assigned a random number between 0 and 100 using the Rand() function. The first IF statement tests for vProblem being less than or equal to 30 and is followed by a .5 minute WAIT time. Subsequent ELSE IF statements compare Percentage with the cumulative percentage of each subsequent percentage option, i.e., 70, 90. The last ELSE statement is assumed to catch the remaining 10% (100% cumulative), which comprise the very difficult problems.


© 2011 ProModel Corporation • 556 East Technology Avenue • Orem, UT 84097 • Support: 888-776-6633 • www.promodel.com