<commit_before>==================
Modelling concepts
==================

| Concepts as items, locations, customers, demands, ...don’t need a much of
  an explanation.
| The modelling concepts of operations, material and capacity consumption
  however need some introduction.

**Operation**

The key modelling element is an operation, which defines an activity
at a given location producing an item.

There are different operation types:

* fixed time: the duration is identical regardless of the planned quantity.
  Eg, a transport operation

* time-per: the duration increases linearly with the planned quantity.
  Eg, a manufacturing operation

* routing: this operation type represent a sequence of sub-operations.

* alternate: an alternate operation models the choice among multiple choices.

| Example:
  Operation 'Make product X' takes 10 minutes per unit.

.. image:: _images/modelling-1.png
   :alt: Modeling - Operation

**Buffer**

Items are stocked in buffers. A buffer, often called SKU -stock keeping unit-,
is a (physical or logical) inventory point.

There are different buffer types:

* default: a buffer that is replenished with a producing operation

* infinite supply: a buffer without replenishing operation

| Example:
| Buffer 'Part A' models inventory of the item 'part A' in location 'my factory'.
| Buffer 'Part B' models inventory of the item 'part B' in location 'my factory'.
| Buffer 'Bulk product' models inventory of the item 'bulk product' in location 'my factory'.

.. image:: _images/modelling-2.png
   :alt: Modeling - Buffer

**Operation materials**

Operations consume and produce material. Operation materials define an
association between an item (either produced or consumed) and an operation.

They therefore represent the Bills of Material (aka BOM) in your model.

When the item is consumed, the quantity should be negative.
When the item is produced, the quantity should be positive.

There are 2 types of operation materials:

* start: The consumption/production occurs at the start of the operation. These are normally consuming
  material and have a negative quantity.

* end: The consumption/production occurs at the end of the operation. These are normally producing
  material and have a postive quantity.

| Example:
| Operation 'Make product X' has 3 operation materials.
| A first operation material to consume 1 units of item A at the start of the
  operation.
| A second operation material to consume 2 units of item B at the start of the
  operation.
| And finally a third operation material to model the production of 1 unit of X
  when the operation finishes.

.. image:: _images/modelling-3.png
   :alt: Modeling - Buffer

**Operation resources**

Operations also require capacity. Capacity is
available in resources and operation resources define an association between the operation
and a resource.

| Example:
| The resource 'production line' is required to perform the operation.

.. image:: _images/modelling-4.png
   :alt: Modeling - Buffer

**Operationplan**

An operation only statically defines the activity, and doesn’t specify any
planned dates or quantities. Concrete activities are then instantiated in
operationplans.

| Example:
| To satisfy a customer demand we plan to run 'Assemble product X' for 12
  units from tomorrow 8am till 10am.
| Another instance of 'Make product X' is planned the next day from 3pm to 4pm
  for 6 units to meet another customer demand.
| Another instance of 'Make product X' for 20 units is planned today to
  replenish a buffer storing the product X to its safety stock level.

**Putting it all together**

Combining all of the above modelling objects we can construct a network
representing the flow of material and usage of capacity in your plant.

The picture below shows a simple network with 3 levels.

.. important::

   Drawing this type of schematic network of your environment is extremely useful
   before you start entering data in frePPLe. Each shape and line in such a
   diagram will be defined as an input record in the frePPLe data model.

.. image:: _images/modelling-5.png
   :alt: Modeling - Buffer
<commit_msg>Updated concepts with the three ways of replenishing a buffer<commit_after>==================
Modelling concepts
==================

| Concepts as items, locations, customers, demands, ...don’t need a much of
  an explanation.
| The modelling concepts of operations, material and capacity consumption
  however need some introduction.

**Buffer**

Items are stocked in buffers. A buffer, often called SKU -stock keeping unit-,
is a (physical or logical) inventory point.

There are different buffer types:

* infinite supply: a buffer for which the inventory is not tracked and that you consider with infinite supply.

* default: a buffer that has to be replenished.

There are three different ways of replenishing a buffer of type default.

- The item can be purchased from a supplier. The valid suppliers for that item have to be declared in the Item suppliers table.

- The item can be transfered from another location within your supply chain. The valid distribution paths for an item have to be declared in the Item distributions table.

- The item can be manufactured. It is therefore produced by an manufacturing operation. The bill of material to produce that item has to be declared in the Operation materials table (with a negative quantity when the item is consumed and a positive quantity when the item is produced)



| Example:
| Buffer 'Part A' models inventory of the item 'part A' in location 'my factory'.
| Buffer 'Part B' models inventory of the item 'part B' in location 'my factory'.
| Buffer 'Bulk product' models inventory of the item 'bulk product' in location 'my factory'.

.. image:: _images/modelling-2.png
   :alt: Modeling - Buffer
  
**Operation**

The key modelling element is an operation, which defines an activity
at a given location producing an item.

There are different operation types:

* fixed time: the duration is identical regardless of the planned quantity.
  Eg, a transport operation

* time-per: the duration increases linearly with the planned quantity.
  Eg, a manufacturing operation

* routing: this operation type represent a sequence of sub-operations.

* alternate: an alternate operation models the choice among multiple choices.

| Example:
  Operation 'Make product X' takes 10 minutes per unit.

.. image:: _images/modelling-1.png
   :alt: Modeling - Operation

**Operation materials**

Operations consume and produce material. Operation materials define an
association between an item (either produced or consumed) and an operation.

They therefore represent the Bills of Material (aka BOM) in your model.

When the item is consumed, the quantity should be negative.
When the item is produced, the quantity should be positive.

There are 2 types of operation materials:

* start: The consumption/production occurs at the start of the operation. These are normally consuming
  material and have a negative quantity.

* end: The consumption/production occurs at the end of the operation. These are normally producing
  material and have a postive quantity.

| Example:
| Operation 'Make product X' has 3 operation materials.
| A first operation material to consume 1 units of item A at the start of the
  operation.
| A second operation material to consume 2 units of item B at the start of the
  operation.
| And finally a third operation material to model the production of 1 unit of X
  when the operation finishes.

.. image:: _images/modelling-3.png
   :alt: Modeling - Buffer

**Operation resources**

Operations also require capacity. Capacity is
available in resources and operation resources define an association between the operation
and a resource.

| Example:
| The resource 'production line' is required to perform the operation.

.. image:: _images/modelling-4.png
   :alt: Modeling - Buffer

**Manufacturing orders**

An operation only statically defines the activity, and doesn’t specify any
planned dates or quantities. Concrete activities are then instantiated in
manufacturing orders.

| Example:
| To satisfy a customer demand we plan to run 'Assemble product X' for 12
  units from tomorrow 8am till 10am.
| Another instance of 'Make product X' is planned the next day from 3pm to 4pm
  for 6 units to meet another customer demand.
| Another instance of 'Make product X' for 20 units is planned today to
  replenish a buffer storing the product X to its safety stock level.

**Putting it all together**

Combining all of the above modelling objects we can construct a network
representing the flow of material and usage of capacity in your plant.

The picture below shows a simple network with 3 levels.

.. important::

   Drawing this type of schematic network of your environment is extremely useful
   before you start entering data in frePPLe. Each shape and line in such a
   diagram will be defined as an input record in the frePPLe data model.

.. image:: _images/modelling-5.png
   :alt: Modeling - Buffer

{'fraction_non_alphanumeric': 0.058452341414812356, 'fraction_numerical': 0.005092438835381379, 'mean_word_length': 4.183017785427424, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3095834', 'n_tokens_mistral': 2232, 'n_tokens_neox': 2162, 'n_words': 1307}