# 1. Define a Use Case

This module is about getting set up for success by clearly and accurately defining the use case you are trying to solve. Once you've defined the use case, you'll be able to identify the expertise you need to teach the system to learn well.

## Learning Objectives

At the end of this module, you will be able to:

* Identify the knowledge components that are key for defining a use case
* Explain actions, sensors, KPI, benchmarks, and ROI
* Identify actions, sensors, and KPI for a real use case

***

## Video Lesson

{% embed url="<https://www.loom.com/share/caa83398cb994056a45e0b4547f42038>" %}

***

## Practice Activity

{% tabs %}
{% tab title="Instructions" %}
Read the production scheduling case study and think about these questions:

* What are some individual control actions?
* What are some sensor variables you would need to track?
* What is the KPI?

Then read on for answers.

<div align="left"><figure><img src="/files/5NmBRdSUMXZvcpsnOz5Z" alt=""><figcaption></figcaption></figure></div>
{% endtab %}

{% tab title="Actions" %}
Here are some of the action variables from the case study. Do these match the actions you thought of?

#### Actions

* Baker A mix cakes - action telling Baker A to start mixing cakes
* Baker B mix cupcakes - action telling Baker B to start mixing cupcakes
* Baker C bake from Mixer 1 - action telling Baker C to bake the product from Mixer 1
* Baker A decorate from Oven 1 - action telling Baker D to decorate the product from Oven 1
* Wait - action telling the system to do nothing for this action step
* And so on for every baker, product, and action combination
  {% endtab %}

{% tab title="Sensors" %}
Here are some of the sensor variables from the case study. Do these match the sensors you thought of?

#### Sensors

* Baker A time remaining - sensor reporting how much time is left on Baker A's task
* Mixer 1 recipe - sensor reporting which product is currently in Mixer 1
* Mixer 2 time remaining - sensor reporting how much time is left on Mixer 2's recipe
* Completed cakes - sensor reporting how many cakes have been bought so far
* Cupcake cost to make - sensor reporting the ingredient cost of making a batch of cupcakes
* Cookie demand - sensor reporting how many cookies are predicted to be sold
* And so on for every baker, equpiment piece, and product
  {% endtab %}

{% tab title="KPI" %}
The KPI for this process is profit.

Profit is not directly measured, but it can be calculated by combining the measures of cost to produce the products, the number of products produced, and the demand.
{% endtab %}
{% endtabs %}

***

## Check Your Understanding

Read the oil blending use case and answer the following questions.

For questions 1-5, characterize each variable as a sensor or an action

1. Amount of crude oil #1 purchased

<details>

<summary>Check your answer</summary>

Action. The amount of each crude purchased per day is one of the key decisions the operator or autonomous system needs to make.

</details>

2. Yield of naphtha from distillation

<details>

<summary>Check your answer</summary>

Sensor. The amount of naphtha that results from distillation is a variable that is determined by how the system is operating.

</details>

3. Yield of kerosene from distillation

<details>

<summary>Check your answer</summary>

Sensor. Just like naphtha, the amount of naphtha that results from distillation is a variable that is determined by how the system is operating

</details>

4. Amount of naphtha sent to reformer

<details>

<summary>Check your answer</summary>

Action. While the amount of naphtha produced in the distillation step is a sensor, the amount of that naphtha that is sent into the next step rather than saved as a finished product is a decision.

</details>

5. Total naphtha available

<details>

<summary>Check your answer</summary>

Sensor. The total amount of naphtha available is an environment property, not a decision.

</details>

6. What would you choose as the KPI for the process?
   1. Throughput: maximize total product created
   2. Waste: minimize unusable product created
   3. Profit: maximize revenue minus costs
   4. Demand satisfaction: minimize unsold product

<details>

<summary>Check your answer</summary>

The answer is C. According to the use case description, the overall goal of the process is to maximize profit.

</details>

7. What is the decision frequency for this process?
   1. 1 minute
   2. 1 hour
   3. 1 day
   4. 1 month
   5. 1 year

<details>

<summary>Check your answer</summary>

The answer is C. According to the use case description, the decision about the blend of oils is made daily.

</details>

For questions 8-9: Measurements that define the characteristics of the different crude and finished oils (for example, density, sulfur, viscosity, wax, and metal content) are not included as variables in the system.

8. Why is it possible to control this process effectively without that information?
   1. These qualities are not important for making decisions about oil blending
   2. That information is assumed to be standard for each crude type and product
   3. It is not possible to directly measure the physical characteristics of the oil stocks and products
   4. This would provide too much information and slow the system down to the point of uselessness

<details>

<summary>Check your answer</summary>

The answer is B. These physical properties are very importnt for oil blending, but they are part of the definition of different crude and product types.

</details>

9. The problem set-up assumes that physical properties are standard within the crude and product types. If in the real world there is variation within these categories, what challenging phenomenon would that represent?
   1. Changing conditions
   2. Different scenarios
   3. Incomplete information
   4. Noise
   5. Funnel states

<details>

<summary>Check your answer</summary>

The answer is D. Variation within the data that is not meaningful for system control is noise.

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.amesa.com/tutorials/solution-design/1.-define-a-use-case.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
