Main > frePPLe Tutorial > Your first model
In this section you'll be introduced to the main modeling constructs and build a simple model.
Our sample company has 2 factories. In the first factory products can be manufactured, stored and then packaged. The second factory packages the products it gets shipped from the first factory.
Raw materials for the manufacturing are procured with a certain lead time from external suppliers.
We assume an infinite supply of the packaging material.
The customers can be supplied with products from both factories, and we prefer to deliver from the factory closest to the customer. Only when the preferred factory can't deliver in time is the other factory is considered as an alternative.
You can manually type in the data in your model. Or download the data file and import it into your frePPLe model as described earlier.
- Calendar
Some parameters in the model varying over time. This can be the capacity of a resource, the working hours at a location, the safety stock in a buffer, etc... These entities are defined in a calendar.
In this model we'll later use calendars to define the working hours of the factories and capacity of the resources.
Download calendar.csv
Name
| Type
| Default value
|
pack capacity factory 1
| calendar_double
| 0
|
pack capacity factory 2
| calendar_double
| 0
|
weave capacity factory 1
| calendar_double
| 0
|
availability of factory 1
| calendar_double
| 1
|
availability of factory 2
| calendar_double
| 1
|
Download calendar_bucket.csv
Calendar
| Start date
| Value
| Priority
| Name
|
pack capacity factory 1
| 1/1/2008 00:00
| 1
| 0
|
|
pack capacity factory 1
| 2/1/2009 00:00
| 2
| 0
|
|
pack capacity factory 2
| 1/1/2008 00:00
| 1
| 0
|
|
weave capacity factory 1
| 1/1/2008 00:00
| 3
| 0
|
|
availability of factory 1
| 1/1/2008 00:00
| 1
| 0
|
|
availability of factory 2
| 1/1/2008 00:00
| 1
| 0
|
|
- Location
A location is a place where resources, buffers and operations are located. The locations could be physical or logical.
In the picture above the locations are marked as rectangle around a number of other entities.
Note that the location references a calendar to define its holidays and working hours.
Download location.csv
Name
| Description
| Available
|
factory 1
|
| availability of factory 1
|
factory 2
|
| availability of factory 2
|
- Item
An item represents an end product, intermediate product or a raw material.
Download item.csv
Name
| Description
|
box
|
|
fabric
| an intermediate product
|
product
| an end item
|
ink
|
|
thread
|
|
- Operation
An operation represents an activity: it consumes and produces material, takes a certain time and also requires capacity.
The material consumption is modelled as a flow: see below.
The capacity consumption is modelled as a load: see below.
In the picture above the operations are shown as the red rectangles.
There are different types of operations.
Fixed_time operations always last for a fixed period of time, regardless of the processed quantity.
Time_per operations take a duration that is proportional to their quantity.
Alternate operations model a choice between different options. The alternatives are listed as sub-operations.
Routing operations model a sequence of operations to be executed in sequence. The steps are listed as sub-operations.
Download operation.csv
Name
| Type
| Location
| Duration
| Duration_per
| Size minimum
| Size multiple
|
Deliver product from factory 1 - 1 day
| operation_fixed_time
| factory 1
| 86400
|
| 1
| 1
|
Deliver product from factory 1 - 7 day
| operation_fixed_time
| factory 1
| 604800
|
| 1
| 1
|
Deliver product from factory 1 or 2
| operation_alternate
|
|
|
| 1
| 1
|
Deliver product from factory 2 - 1 day
| operation_fixed_time
| factory 2
| 86400
|
| 1
| 1
|
Deliver product from factory 2 - 7 day
| operation_fixed_time
| factory 2
| 604800
|
| 1
| 1
|
Deliver product from factory 2 or 1
| operation_alternate
|
|
|
| 1
| 1
|
Make fabric @ factory 1
| operation_time_per
| factory 1
| 0
| 3600
| 1
| 1
|
Pack product @ factory 1
| operation_fixed_time
| factory 1
| 86400
|
| 1
| 1
|
Pack product @ factory 2
| operation_fixed_time
| factory 2
| 86400
|
| 1
| 1
|
Purchase box @ factory 1
| operation_fixed_time
| factory 1
| 604800
|
| 400
| 50
|
Purchase box @ factory 2
| operation_fixed_time
| factory 2
| 604800
|
| 400
| 50
|
Purchase ink @ factory 1
| operation_fixed_time
| factory 1
| 604800
|
| 1
| 50
|
Purchase thread @ factory 1
| operation_fixed_time
| factory 1
| 1209600
|
| 500
| 1
|
Transport fabric from factory 1 to 2
| operation_fixed_time
|
| 172800
|
| 1000
| 1
|
Download suboperation.csv
Operation
| Suboperation
| Priority
|
Deliver product from factory 2 or 1
| Deliver product from factory 2 - 1 day
| 1
|
Deliver product from factory 1 or 2
| Deliver product from factory 2 - 7 day
| 2
|
Deliver product from factory 1 or 2
| Deliver product from factory 1 - 1 day
| 1
|
Deliver product from factory 2 or 1
| Deliver product from factory 1 - 7 day
| 2
|
- Buffer
A buffer is a storage for a item. It represents a place where inventory of an item is kept.
Operations consume material from or produce into buffers using flows: see below.
There are buffers of different types.
Infinite buffers have an indefinite supply and will never constrain the plan.
Default buffers don't have an infinite supply, and the field producing defines the operation that needs to be planned to replenish the buffer.
Download buffer.csv
Name
| Location
| Item
| Onhand
| Type
| Producing
|
box @ factory 1
| factory 1
| box
| 30
| buffer_infinite
|
|
box @ factory 2
| factory 2
| box
| 40
| buffer_infinite
|
|
fabric @ factory 1
| factory 1
| fabric
| 0
|
| Make fabric @ factory 1
|
fabric @ factory 2
| factory 2
| fabric
| 0
|
| Transport fabric from factory 1 to 2
|
ink @ factory 1
| factory 1
| ink
| 0
|
| Purchase ink @ factory 1
|
product @ factory 1
| factory 1
| product
| 0
|
| Pack product @ factory 1
|
product @ factory 2
| factory 2
| product
| 10
|
| Pack product @ factory 2
|
thread @ factory 1
| factory 1
| thread
| 50
|
| Purchase thread @ factory 1
|
- Flow
Flows are used to model the consumption and production of material.
They create a link/assiocation between an operation and a buffer.
In the picture above the flows are visible as arrows between a buffer and an operation. Arrows from a buffer to an operation represent consumption of material, and arrows starting from operation represent material that is produced.
Download flow.csv
Operation
| Buffer
| Type
| Quantity
|
Pack product @ factory 1
| product @ factory 1
| flow_end
| 1
|
Pack product @ factory 2
| product @ factory 2
| flow_end
| 1
|
Purchase box @ factory 1
| box @ factory 1
| flow_end
| 1
|
Purchase box @ factory 2
| box @ factory 2
| flow_end
| 1
|
Purchase ink @ factory 1
| ink @ factory 1
| flow_end
| 1
|
Purchase thread @ factory 1
| thread @ factory 1
| flow_end
| 1
|
Make fabric @ factory 1
| fabric @ factory 1
| flow_end
| 1
|
Deliver product from factory 1 - 1 day
| product @ factory 1
| flow_start
| -1
|
Deliver product from factory 1 - 7 day
| product @ factory 1
| flow_start
| -1
|
Deliver product from factory 2 - 1 day
| product @ factory 2
| flow_start
| -1
|
Deliver product from factory 2 - 7 day
| product @ factory 2
| flow_start
| -1
|
Make fabric @ factory 1
| thread @ factory 1
| flow_start
| -3
|
Make fabric @ factory 1
| ink @ factory 1
| flow_start
| -2
|
Pack product @ factory 1
| fabric @ factory 1
| flow_start
| -1
|
Pack product @ factory 2
| fabric @ factory 2
| flow_start
| -1
|
Pack product @ factory 1
| box @ factory 1
| flow_start
| -1
|
Pack product @ factory 2
| box @ factory 2
| flow_start
| -1
|
Transport fabric from factory 1 to 2
| fabric @ factory 2
| flow_end
| 1
|
Transport fabric from factory 1 to 2
| fabric @ factory 1
| flow_start
| -1
|
- Resource
Resources represent capacity. They represent a machine, a worker or a group of workers, or some logical limits.
Operations consume capacity using loads: see below.
The picture above shows the name of the resource.
Note how the resource point to a calendar for the definition of their maximum capacity.
Download resource.csv
Name
| Location
| Maximum
|
pack in factory 1
| factory 1
| pack capacity factory 1
|
pack in factory 2
| factory 2
| pack capacity factory 2
|
weave in factory 1
| factory 1
| weave capacity factory 1
|
- Load
Loads are used to model the capacity consumption of an operation.
They are displayed as a dashed line in the above picture.
In this model we'll claim 1 unit on the resource for each operation.
Download load.csv
Operation
| Resource
| Quantity
|
Pack product @ factory 1
| pack in factory 1
| 1
|
Pack product @ factory 2
| pack in factory 2
| 1
|
Make fabric @ factory 1
| weave in factory 1
| 1
|
- Demand
Defines independent demands for items. These can be actual customer orders, or forecasted demands.
The actual demands are not shown in the above picture, but the operations (big red rectangles)you see on the right are the delivery operations that are planned to satisfy the demand.
In this example the delivery operations are alternate operations, modelling the choice to meet the demand from the 2 factories.
Note how the demand points to an operation that will need to be planned to satisfy the demand.
Download demand.csv
Name
| Item
| Due
| Quantity
| Minimum shipment
| Delivery operation
| Priority
|
Demand 1
| product
| 4/4/2009 00:00
| 100
| 100
| Deliver product from factory 1 or 2
| 1
|
- Parameter
Finally, we need to update an important parameter in the model.
Locate the record currentdate in the parameter table and change its value to 2009-01-01 00:00:00. This parameter defines the start date of the planning horizon. If the parameter is missing or incorrectly formatted frePPLe use the system date of your computer.
The second parameter loading_time_units is optional and selects the units to use in the resource loading report.
Download parameter.csv
Name
| Value
| Description
|
currentdate
| 2009-01-01 00:00:00
| Current date of the plan, formatted as YYYY-MM-DD HH-MM-SS
|
loading_time_units
| days
| Time units to be used for the resource report: hours, days, weeks
|
- Verify the supply path
The supply path shows the modelled supply chain.
You can follow the supply chain "downstream", i.e. starting from raw materials and moving step by step towards the end item. Click on an operation, buffer or resource and select "where used" in the popup menu to see the downstream supply path.
You can also follow the supply chain "upstream", i.e. starting from the end item and tracking step by step which material and capcity it takes to produce it. Click on an operation, buffer or resource and select "supply path" to see the upstream supply path.
If all went well, the "where used" report for the buffer "ink @ factory 1" will look as follows. You can easily trace the different elements shown in the picture above.

- If you didn't complete all of the above steps successfully, you're lucky: there is a fixture available that let's you catch up.
Open the menu item "execute" and hit the "erase" button. Next, select the "tutorial 1" dataset from the list and hit the "load" button.