# Autoplan

### What is Autoplan?

Autoplan is IONs **Material Requirements Planning** engine to calculate the tasks required (plan items) to build end products (plan inputs). It is an automated planner for your factory.

Below shows an overview of plans.

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

### How does it work?

1. backward schedules demand from the plan input **Need by** date
2. allocates existing and active supply in the factory (inventory, purchase orders, and runs) to those demands
   * Supply is allocated in the order of:
     * Inventory first
     * Purchase orders/runs based on highest percentage complete
     * Primary parts allocated before substitute parts
3. generates plan items

The main inputs for Autoplan are:

* plan inputs (master schedules) on plans with **include in MRP** set to true and a status of in progress or scheduled
* part properties
  * mBOMs
  * part lead times
* existing/active supply
  * open purchase order lines (status is not received or cancelled)
  * open runs (status is not complete, cancelled, or archived)
  * inventories with a quantity > 0 that are not on open purchase orders or runs

Accurate data is requried on these inputs to ensure Autoplan generates accurate results.

Autoplan is currently an infinite capacity model, which means that it does not consider resource constraints, but it will in the near future.

#### Substitutes

Autoplan will allocate substitute supply if is available. Substitutes get defined in the manufacturing bill of material (mBOM). Supply for substitutes will always get allocated in the order of the primary part first and then the substitute. The goal is to use existing supply as efficiently as possible.

Any new planned items that get created by Autoplan will get created for the primary part and not the substitute.

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

#### How is demand driven?

When Autoplan is creating demand for child components, it will use the latest released mBOM version when an mBOM is released, otherwise, it will use the latest mBOM version in draft.

Take for example the mBOM below. When a new plan item is generated for Assembly A, it will also create demand for x1 Part B and x2 Part Cs.

{% @mermaid/diagram content="graph TD
A\[Assembly A] -->|x1| B\[Part B]
A -->|x2| C\[Part C]
" %}

The exception to this is when a run for Assembly is allocated. Instead of using the mBOM to drive demand, it will use the aBOM.

{% @mermaid/diagram content="%%{init: {'theme':'forest'}}%%
graph TD
A\[RUN-123 \n Assembly A] -->|x1| B\[Part B]
A -->|x2| C\[Part C]" %}

In this case, RUN-123 is allocated to a plan. It will drive demand for parts B + C based on the open build requirements (aBOM).

As soon as parts are installed for B or C, the demand will disappear from Autoplan. This is done because the plan data only reflects work that is progress or remaining.

Demand is also removed when items are kitted and the kit is tied to the run. For instance, let's say we've kitted x1 Part C to KIT-456, which is tied to RUN-123. This would cause demand to be created for only x1 Part C instead of x2.

### How is Autoplan triggered?

Autoplan can be run by clicking the **Run MRP** button on the plan search page.

After clicking this button, an MRP job will be queued and will run when previous MRP jobs (if any) have completed.

![](https://3615148728-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LkRqYp6lJhwxjYdzYG8%2Fuploads%2FEMnlfwkb9Batk6GKpd4M%2Fezgif-1-9f941059d3%202123.gif?alt=media\&token=d4383cc5-cff3-44dc-81fa-b54c30ee2030)

### Let's do an example!

#### Step 1: Create the plan

* Make sure that the plan is **Included in MRP**
* Set a need date for your top level part
  * Here we're saying that we want x1 of *MRP test part 1* completed for 6/17/21
* Set the plan status to **In progress**

![Configure plan for MRP](https://3615148728-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LkRqYp6lJhwxjYdzYG8%2Fuploads%2FTVgonAZP6mcqmG6IMUwA%2Fezgif-1-3920ac717e%202136.gif?alt=media\&token=690c675d-6134-45db-87c9-1ae90f7a01d5)

#### Step 2: Setup part properties

For the below parts, note the lead time and mBOM:

* *MRP test part 1*
  * lead time: 10 days
  * child part: MRP test part 2
* *MRP test part 2*
  * lead time: 20 days
  * child part: MRP test part 3
* *MRP test part 3*
  * lead time: 30 days

![](https://3615148728-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkRqYp6lJhwxjYdzYG8%2F-MYh7-hTMoGnhgaR1Quc%2F-MYh_7hX7pSnhK5s7WML%2Fimage.png?alt=media\&token=f53b8249-2b10-466e-a834-fd3414e8ff20)

![](https://3615148728-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkRqYp6lJhwxjYdzYG8%2F-MYh7-hTMoGnhgaR1Quc%2F-MYh_Gwionl7vAxtEjiI%2Fimage.png?alt=media\&token=9dfe58e4-bcaf-4366-8290-3fd420cc998a)

![](https://3615148728-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkRqYp6lJhwxjYdzYG8%2F-MYh7-hTMoGnhgaR1Quc%2F-MYh_Ri5TbgSSlMtH4aO%2Fimage.png?alt=media\&token=465e5276-e8b8-4e16-bd52-aa1efd06c115)

**Step 3: Run MRP and view results**

Now we can run MRP as shown above and view the results on **Plan #20** when it completes:

![](https://3615148728-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkRqYp6lJhwxjYdzYG8%2F-MYh7-hTMoGnhgaR1Quc%2F-MYhf1hNmM3JjTT2LS7I%2Fimage.png?alt=media\&token=2d177ec4-d61b-4c5a-969e-037e2192b535)

Note the following in the above screenshot:

1. The date of the last completed MRP job is displayed
2. The dates for the plan items are generated based on the backwards schedule from the plan input.
   * The plan input has a date of 6/17/21 for *MRP test part 1*
   * The plan item to make *MRP test part 1* has a due date of 6/17/21 and a start date that backs out it's lead time (10 days)
   * *MRP test part 1*'s child *MRP test part 2*, has a due date of 6/7/21 and a start date of 5/18/21 (20 day lead time)
3. The quantity for the plan item for *MRP test part 3* is 8. This is because MRP test part 1 requires 2 of *MRP test part 2* and *MRP rest part 2* requires 4 of *MRP test part 4*
4. All plan items generated by MRP have a badge displayed on the far right to differentiate them from manually created plan items

Plan items also can be viewed here in hierarchal format by toggling the H**ierarchal** option. Below shows *MRP test part 1* and clicking on that plan item will show its child *MRP test part 2*.

![](https://3615148728-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkRqYp6lJhwxjYdzYG8%2F-MYh7-hTMoGnhgaR1Quc%2F-MYhjvIrDmydb0auawo2%2Fimage.png?alt=media\&token=a5d2bfc9-121d-4e13-94af-f6f0caf84db2)

### Example #2

Now let's throw some supply in the mix by creating inventory for *MRP test part 2*:

![](https://3615148728-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LkRqYp6lJhwxjYdzYG8%2Fuploads%2FfyLI88ZrUvLt8vRticLh%2Fezgif-1-6cb003d29a%202234.gif?alt=media\&token=39a812fd-184e-4b6d-9024-e220b0a57be6)

After creating the inventory and running MRP again, here are the new results:

![](https://3615148728-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkRqYp6lJhwxjYdzYG8%2F-MYh7-hTMoGnhgaR1Quc%2F-MYhpVSzz2zmNylEa90-%2Fimage.png?alt=media\&token=d0fee005-2172-4c3b-931c-7b5149eb7bba)

The MRP job supersedes the previous results with newly generated plan items.

Note that:

* The inventory item for *MRP test part 2* is linked to the plan item
* There is no longer a plan item generated for *MRP test part 3*:
  * **Why?** Now that there is inventory for *MRP test part 2*, there is no longer a need to create *MRP test part 3* parts


---

# 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://manual.firstresonance.io/plans-and-autoplan/autoplan.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.
