frePPLeOpen source Production Planning
  • Home
  • Documentation
  • C++ API

5 – Your first model

In this section you’ll be introduced to the main modelling 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 which 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.

tutorial

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.
Since the different objects refer to each other, it is required to follow the sequence outlined below.

  • Calendar
    A calendar models a value in the model that is varying over time. This can be the capacity of a resource, the working hours at a location, the safety stock in a buffer, etc…In this model, the calendar “Working Days” defines a variable with value 1 from Monday through Friday, and a (default) value of 0 on Saturday and Sunday.
    The calendar “pack capacity factory 1″ defines a variable with (default) value of 0 before
    1/1/2012, a value of 1 between 1/1/2012 and 2/1/2012, and a value of 2 after 2/1/2012.
    We’ll later use these calendars to define the working hours of the factories and capacity of the resources.
Name Default value
pack capacity factory 1 0
pack capacity factory 2 0
weave capacity factory 1 0
Working days 1
Download calendar.csv
Calendar Start Date End Date Value Priority Monday Tuesday Wednesday Thursday Friday Saturday Sunday
pack capacity factory 1 1/1/2012 0:00 12/31/2030 0:00 1 100 TRUE TRUE TRUE TRUE TRUE TRUE TRUE
pack capacity factory 1 2/1/2012 0:00 12/31/2030 0:00 2 99 TRUE TRUE TRUE TRUE TRUE TRUE TRUE
pack capacity factory 2 1/1/2012 0:00 12/31/2030 0:00 1 100 TRUE TRUE TRUE TRUE TRUE TRUE TRUE
weave capacity factory 1 1/1/2012 0:00 12/31/2030 0:00 3 100 TRUE TRUE TRUE TRUE TRUE TRUE TRUE
Working Days 1/1/2001 0:00 12/31/2030 0:00 1 0 TRUE TRUE TRUE TRUE TRUE FALSE FALSE
Download calendar_bucket.csv

 

  • 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.

Name Available
factory 1 Working Days
factory 2 Working Days
Download location.csv
  • Item
    An item represents an end product, intermediate product or a raw material.
Name Description
box
fabric an intermediate product
ink
product an end item
thread
Download item.csv
  • 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.
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 operation.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
Download suboperation.csv
  • 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 different types of buffers:

    • Infinite buffers have an indefinite supply and will never constrain the plan.
    • Default buffers have a finite supply, and the field producing defines the operation that needs to be planned to replenish the buffer.
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
Download buffer.csv

 

  • 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.
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 -1
Deliver product from factory 1 – 7 day product @ factory 1 -1
Deliver product from factory 2 – 1 day product @ factory 2 -1
Deliver product from factory 2 – 7 day product @ factory 2 -1
Make fabric @ factory 1 thread @ factory 1 -3
Make fabric @ factory 1 ink @ factory 1 -2
Pack product @ factory 1 fabric @ factory 1 -1
Pack product @ factory 2 fabric @ factory 2 -1
Pack product @ factory 1 box @ factory 1 -1
Pack product @ factory 2 box @ factory 2 -1
Transport fabric from factory 1 to 2 fabric @ factory 2 flow_end 1
Transport fabric from factory 1 to 2 fabric @ factory 1 -1
Download flow.csv
  • 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.

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
Download resource.csv
  • Load
    Loads are used to model the capacity consumption of an operation.
    They are displayed as a dashed line in the above picture.During the complete duration of an operationplan the resource will be claimed. If a certain operation loads 2 units of a resource for 3 days, a total of 6 unit*days of capacity on the resource will be utilized.In this model we’ll load 1 unit on the resource for each operation.
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
Download load.csv
  • 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.

Name Item Due Quantity Minimum shipment Delivery operation Priority
Demand 1 product 5/5/2012 0:00 100 100 Deliver product from factory 1 or 2 1
Download demand.csv
  • 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 2012-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.
Name Value Description
currentdate 1/1/2012 0: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
Download parameter.csv
  • 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.

supplypath
  • 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.
    • Getting started
      • 1 – Introduction
      • 2 – Installation
      • 3 – Entering data
      • 4 – Modelling concepts
      • 5 – Your first model
      • 6 – Your first plan
    • Modeling guide
      • Simplified domain model
      • Detailed domain model
      • Environment variables
      • Python interpreter
      • Global parameters
      • Buffer
      • Calendar
      • Customer
      • Demand
      • Flow
      • Item
      • Load
      • Location
      • Operation
      • Suboperation
      • Operationplan
      • Problem
      • Resource
      • SetupMatrix
      • Skill
      • Resource skill
      • Solver
    • User guide
      • Supported browsers
      • Getting around
        • Logging in
        • Logging out
        • Changing password
        • Navigation
          • Menu bar
          • Jump search
          • Context menus
        • Filtering data
        • Sorting data
        • Selecting time buckets
        • Exporting data
        • Importing data
        • Customizing a screen
        • User preferences
        • User permissions and roles
        • Comments
        • History – Audit trail
      • Data maintenance screens
      • Supply Path / Where Used
      • Plan analysis screens
        • Problem report
        • Constraint report
        • Inventory report
        • Inventory detail report
        • Resource report
        • Resource Gantt report
        • Resource detail report
        • Operation report
        • Operation detail report
        • Demand report
        • Demand detail report
        • Demand Gantt report
        • Forecast report
        • Performance indicator report
      • Execution screen
      • Batch commands
        • frepplectl
        • frepple
        • freppleservice.exe (Windows only)
    • Installation guide
      • Windows installer
      • Compiling on Windows
      • Linux binary packages
      • Compiling on Linux
      • Compiling from the source code repository
      • Running the VMWare virtual machine
      • Other platforms
      • Configuring multiple models in the user interface
      • Configuring as a Python extension module
    • Extension modules
      • Forecast module
      • Order quoting module
      • REST web service module
      • OpenERP connector module
      • Linear programming solver module
    • Technical guide
      • Architecture
      • Source code repository
      • User interface
        • Creating an extension app
        • Translating the user interface
        • Adding or customizing a report
        • Style guide
      • Solver engine
        • Code structure
        • Class diagram
        • Planning algorithm
          • Top level loop
          • Demand solver
          • Buffer solver
          • Flow solver
          • Load solver
          • Operation solver
          • Resource solver
        • Cluster and level algorithm
        • Extension modules
        • Style guide
        • Portability
      • Security
      • Unit tests
        • buffer_procure_1
        • calendar
        • callback
        • cluster
        • constraints_combined_1
        • constraints_combined_2
        • constraints_leadtime_1
        • constraints_material_1
        • constraints_material_2
        • constraints_material_3
        • constraints_material_4
        • constraints_resource_1
        • constraints_resource_2
        • constraints_resource_3
        • constraints_resource_4
        • constraints_resource_5
        • datetime
        • deletion
        • demand_policy
        • flow_alternate_1
        • flow_alternate_2
        • flow_effective
        • forecast_1
        • forecast_2
        • forecast_3
        • forecast_4
        • forecast_5
        • forecast_6
        • jobshop
        • load_alternate
        • load_effective
        • lpsolver_1
        • multithreading
        • name
        • operation_alternate
        • operation_available
        • operation_effective
        • operation_pre_post
        • operation_routing
        • pegging
        • problems
        • python_1
        • python_2
        • python_3
        • safety_stock
        • sample_module
        • scalability_1
        • scalability_2
        • scalability_3
        • setup_1
        • setup_2
        • skill
        • xml
        • xml_remote
    • FAQ
    • License
      • GNU Affero General Public License
      • GNU Free Documentation License
    • Third party add-ons
  • Copyright © 2010-2013 frePPLe bvba