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

SetupMatrix

A setup matrix defines the time and cost of setup conversions on a resource. Within a setup matrix rules are used to define the changeover cost and duration.

To compute the time of a changeover the algorithm will evaluate all rules in sequence (in order of priority).
For a rule to match the changeover between the original setup X to a new setup Y, two conditions need to be fulfilled:

  • The original setup X must match with the fromsetup of the rule.
    If the fromsetup field is empty, it is considered a match.
  • The new setup Y must match with the tosetup of the rule.
    If the tosetup field is empty, it is considered a match.

The wildcard characters * and ? can be used in the fromsetup and tosetup fields.
As soon as a matching rule is found, it is applied and subsequent rules are not evaluated.
If no matching rule is found, the changeover is not allowed.

For instance, consider a setup matrix with the following rules:

Priority From To Duration Cost
1 *green *green 0 10
2 *red *red 0 10
3 *green *red 1 day 50
4 *green 2 day 50
5 3 day 50

Based on this matrix:

  • A change from “lightgreen” to “darkgreen” takes no time, but costs 10. Rule 1 applies.
  • A change from “green” to “black” takes 2 days and costs 50. Rule 4 applies.
  • A change from “red” to “black” takes 3 days and costs 50. Rule 5 applies.
    Without rule 5 this changeover would not be allowed.

Fields

Field Type Description
name non-empty string Name of the setup matrix.
This is the key field and a required attribute.
rules list of setup matrix rules A read-only list of rules in this matrix.
action A
C
AC (default)
R
Type of action to be executed:

  • A: Add an new entity, and report an error if the entity already exists.
  • C: Change an existing entity, and report an error if the entity doesn’t exist yet.
  • AC: Change an entity or create a new one if it doesn’t exist yet.
  • R: Remove an entity, and report an error if the entity doesn’t exist.
Method Description
addRule(priority=[integer], fromsetup=[string], tosetup=[string], duration=[timeperiod], cost=[number]) This method adds a new rule to the matrix.
Only the priority keyword is compulsory. The other arguments are optional.

Setup Rule

Within a setup matrix rules are used to define the changeover cost and duration.
The rules are evaluated in sequence, starting with the lowest priority number.

Field Type Description
priority integer The priority of the rule. Rules are evaluated in the order of priority – lower numbers first.
This is the key field
fromsetup String The previous setup.
If the field is empty the rules applies to any previous setup value.
Wildcard characters are allowed in this string:

  • * matches a sequence of characters
  • ? matches a single character
tosetup String The new setup.
If the field is empty the rules applies to any new setup value.
Wildcard characters are allowed in this string, similar as in the fromsetup field.
duration timeperiod Duration of the changeover.
cost double Cost of the changeover.

Example XML structures

  • Adding or changing setup matrices
     <plan>
       <setupmatrices>
          <setupmatrix name="Painting line changeover">
            <rules>
              <rule priority="1" 
                 fromsetup="green" tosetup="red" 
                 duration="P0D" cost="10" />
              <rule priority="2" 
                 fromsetup="red" tosetup="green" 
                 duration="P0D" cost="10" />
              <rule priority="3" 
                 fromsetup="white" tosetup="black" 
                 duration="P10D" cost="50"/>
              <rule priority="4" 
                 fromsetup="black" tosetup="white" 
                 duration="P10D" cost="50"/>
              <rule priority="5" fromsetup="yellow" 
                 duration="P2D" cost="20"/>
              <rule priority="6" tosetup="yellow" 
                 duration="P2D" cost="20"/>
              <rule priority="6" 
                 duration="P3D" />
            </rules>
          </setupmatrix>
       </setupmatrices>
     </plan>
  • Deleting a setup matrix
     <plan>
        <setupmatrtices>
           <setupmatrtix name="changovers" action="R"/>
        </setupmatrtices>
     </plan>

Example Python code

  • Adding or changing setup matrices
        matrix = frepple.setupmatrix(name="changeovers for paint line")
        matrix.addRule(priority=1, fromsetup="*green", cost=10)
  • Deleting a setup matrix
        frepple.setupmatrix(name="changeovers for paint line", action="R")
  • Iterate over setup matrices and setup matrix rules
        for m in frepple.setupmatrices():
          print "Matrix '%s' has the following rules:" % m.name
          for i in m.rules:
            print " ", i.priority, i.tosetup, i.fromsetup, 
            print i.duration, i.cost
    • 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