ProcessModel 7 Self Teach GuideChapter 8

Chapter 8. Tag Each Customer and Count the Jobs

By the end of this chapter you can

Tag each customer with an attribute and count jobs with a variable and Action Logic.

Watch the video (7 minutes), then work through the lesson below it in ProcessModel, step by step.

Title card: Self Teach Guide, Chapter 8. Tag each customer and count the jobs.

Chapter 8 watched

Now work through the lesson

The video could not be played here.

Watch on YouTube
Length 6 minutes 53 seconds

Before you start

So far every walk-in customer was alike, and nothing in the model kept count of anything. A real shop knows more: what kind of phone each customer brought, and how many jobs are done today. This chapter gives the model that memory, with three tools that work together in almost every serious model:

  • An attribute travels with each customer. Every customer carries its own value, so two customers can hold different ones. Here: each customer’s phone type, Newer or Older. Attribute names start with a_.
  • A variable is one value for the whole model, shared by everything in it. Here: the number of jobs done. Variable names start with v_.
  • Action Logic is a short set of instructions that runs on each customer as it passes a step. It is how you set an attribute, raise a count, and act when something happens.

A name must be declared before logic can use it. ProcessModel never makes one up: a name used in logic that has not been declared is refused. So you declare the attribute and the variable first, then write the logic.

Here is what changes in the shop:

PartChapter 7Chapter 8
Phone typeNoneCheck In gives each customer a phone type: 8 in 10 Newer, 2 in 10 Older
Older phonesWalk-ins all try Quick Fix firstCustomers with an Older phone skip Quick Fix and go straight to the Repair Queue, with the office customers
Job countNonePick Up counts each finished job, and shows a message at the 30th
Everything elseAs Chapter 7 left itUnchanged; no shape moves

You need your Phone Repair Shop from Chapter 7 (or the practice model below) and about forty minutes.

Step 1. Open your shop

  1. On the Welcome screen, under Recent Models, click Phone Repair Shop.

What you should see: the shop as Chapter 7 left it, with two Technicians on real shifts.

Step 2. Declare the attribute

  1. On the toolbar, click Logic Builder. It opens on Entity attributes.
  2. Click Add new, and click in Name. The box shows the a_ prefix; type PhoneType after it.
  3. Set Type to Descriptive: its values are words, not numbers.
  4. Click Descriptor List and type Newer, Older: the values a phone type can take.
The Logic Builder on Entity attributes, with one row: Name a_PhoneType, Type Descriptive, Descriptor List Newer, Older. Save definitions at the foot.
Figure 1. The attribute a_PhoneType, a word: Newer or Older.

Step 3. Declare the variable

  1. Click Global variables, then Add new.
  2. Click in Name, after the v_ prefix, and type JobsDone. It is an Integer, starting at 0.
The Logic Builder on Global variables, with one row: Name v_JobsDone, Type Integer, Initial Value 0.
Figure 2. The variable v_JobsDone, a whole number starting at 0.
  1. Click Save definitions. Nothing is kept until you do.

Why one is an attribute and the other a variable: the phone type belongs to each customer, so it must travel with them. The job count belongs to the shop, so there is only one.

Step 4. Give each customer a phone type at Check In

  1. Click Check In and open its Logic tab.
  2. Click Compose. The Action Logic Builder opens. It builds the logic from cards, so you do not need to remember how to write it.
  3. Click Add Action, search for SET Attribute, and pick it.
  4. Choose a_PhoneType from its list.
  5. Click the value box and type D2(80, “Newer”, 20, “Older”), with the words in quotes.
The Action Logic Builder for Check In with one card: SET a_PhoneType TO D2(80, "Newer", 20, "Older"). The foot reads 1 Logic Step, with Cancel and Save Logic.
Figure 3. One card: SET a_PhoneType TO D2(80, "Newer", 20, "Older"), ready to save.

D2 picks one of two values by percent: 80 percent of customers get “Newer” and 20 percent get “Older”. The percents must add up to 100, which the app checks as you type.

  1. Click Save Logic. The Logic tab now shows the line the card wrote: SET a_PhoneType TO D2(80, "Newer", 20, "Older").
Check In's Logic tab, with its Open Editor window open over the canvas showing the whole line: SET a_PhoneType TO D2(80, "Newer", 20, "Older"), and No issues. In the Logic tab beside it the same line is cut short.
Figure 4. The line the card wrote, whole in Open Editor; the Logic tab beside it is too narrow to show all of it.

Every customer who passes Check In now carries its own phone type, drawn at random.

Step 5. Route older phones straight to the Repair Queue

The route from Check In to the Repair Queue already sends the office customers there by a condition. Add a second condition, so it also takes any customer with an Older phone.

  1. Click the route from Check In to the Repair Queue and open its General tab. Its condition reads Entity Name equals Office Customer.
  2. Click Add Condition. Set the new row’s Type to Attribute, choose a_PhoneType, and type Older.
  3. Click ANY (OR). The line above the rows now reads IF ANY of these are true.
The route's properties: type Conditional, with ALL (AND) and ANY (OR) buttons, ANY selected. The line reads IF ANY of these are true. Two condition rows: Entity Name equals Office Customer, and Attribute a_PhoneType equals Older.
Figure 5. Two conditions joined by ANY: office customers, or any customer with an Older phone.

ALL or ANY matters. With ALL (AND), a customer would need to be an office customer and have an Older phone. With ANY (OR), either one is enough. This route now takes the office customers, or any customer whose phone type is Older. Everyone else still takes the catch-all to Quick Fix.

Step 6. Count the jobs at Pick Up

Every customer leaves through Pick Up, so it is the place to count.

  1. Click Pick Up, open its Logic tab, and click Compose.
  2. Click Add Action, search for INC Variable, and pick it. Choose v_JobsDone; by shows 1. Each customer now adds 1 to the count.
  3. Click Add Action again, search for If, and pick it. For its condition, type v_JobsDone = 30.
  4. Inside the If card, click its own Add Action and pick DISPLAY. Click the message box and type {v_JobsDone} jobs done. The braces put the count’s live value into the message.
The Action Logic Builder for Pick Up with two cards: Increment v_JobsDone by 1, and an If card with the condition v_JobsDone = 30 holding a Display card whose message reads {v_JobsDone} jobs done.
Figure 6. Count each job, and at the 30th, show a message.
  1. Click Save Logic.
Pick Up's Logic tab with four lines: INC v_JobsDone; IF v_JobsDone = 30 THEN; DISPLAY "{v_JobsDone} jobs done"; ENDIF.
Figure 7. The four lines the cards wrote. The If adds ENDIF to close itself.

What you should see: four lines in the Logic tab. Reading them is worth a moment, because this is what logic looks like everywhere in ProcessModel: raise the count; if it has reached 30, show the message; end of the if.

Step 7. Watch the logic work

  1. Click Run Simulation, and watch Check In from 7.

At 7:06, a walk-in leaves Check In straight for the Repair Queue, and the label over Check In reads Condition, Repair Queue. Before 10 only walk-ins arrive, so every customer on that route has an Older phone: the attribute at work.

The shop just after 7 in the morning. Over Check In, a label reads Condition, Repair Queue, and a customer is on its way to the Repair Queue. The cards still read 0.
Figure 8. The first customer with an Older phone goes straight to the Repair Queue.

At 10 the office sends twelve, and they take the same route. Just before 1, the 30th customer leaves Pick Up, the count reaches 30, and the run stops on a Simulation Message.

A Simulation Message window over the running shop. It reads 30 jobs done. Its foot reads Time 12:59 and Activity Pick Up, with End Simulation and Continue buttons.
Figure 9. The message at the 30th job. Its foot names the time and the activity.

The message names the time and the step that showed it. The run holds until you click Continue (or End Simulation). Click Continue, and the day goes on.

Step 8. Read the cards

Simulation Complete reads 60.00 entities processed. The cards read Throughput 60.0 per day, Avg Throughput Time 51 min, WIP 0.0 and Process Efficiency 28.1%.
Figure 10. 60 customers, 51 minutes in the shop, 28.1% efficiency.
  • 60 went through.
  • Avg Throughput Time, 51 minutes, as in Chapter 7.
  • WIP, 0: at midnight the shop is empty.
  • Process Efficiency, 28.1%, up from 27.4%: a slightly larger share of each customer’s time is spent being worked on.

The numbers barely moved, and that is a lesson too: this chapter changed who goes where, not how much work there is. The bigger gain is that the model now knows each customer’s phone and the day’s count, which later chapters build on. One run, one possible Monday. Click No.

Step 9. Save it

  1. Click File, then Save. The star leaves the title bar. Chapter 9 starts from this shop.

Your practice model

  1. Start fromChapter 7. Give Your Technicians Real Working HoursThe shop as Chapter 7 left it. Use your own saved Phone Repair Shop instead if you built it.
  2. Compare withChapter 8. Tag Each Customer and Count the JobsThe shop as this chapter leaves it. Open it when you are done, and check your settings against it.

Both are in File ▸ Demo Models, in the Self Teach Guide group. A demo model opens as a new model, so the original never changes.

Check yourself

  1. Question 1Why is the phone type an attribute, while the job count is a variable?
  2. Question 2The route's two conditions are joined by ANY (OR). Which customers take it?
  3. Question 3You write logic that uses v_Backlog, but you never declared it in the Logic Builder. What happens?

Try it yourself

Count something else: how many customers with an Older phone come in a day.

  1. In the Logic Builder, on Global variables, add v_OlderPhones, an Integer starting at 0, and click Save definitions.
  2. On Check In’s Logic tab, click Compose, and under the SET card add an If with the condition a_PhoneType = “Older”. Inside it, add INC Variable for v_OlderPhones. Click Save Logic.
  3. To see the count, open Pick Up’s Logic tab, click Compose, and change the DISPLAY message to {v_JobsDone} jobs done, {v_OlderPhones} older phones. Click Save Logic.

Mark it done

When you can say when to use an attribute and when a variable, turn on Done.

You watched this chapter's video.Not watched yet: the video is marked when it plays to the end.

Kept in this browser only, and shown on the course page.

All 15 chapters of the Self Teach Guide