Scheduling and Planning With Constraint Logic Programming

Embed Size (px)

Citation preview

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    1/152

    COSYTEC 1Copyr ight 1995, COSYTEC SA

    Constraint Logic Programming

    COSYTEC SA

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    2/152

    COSYTEC 2Copyr ight 1995, COSYTEC SA

    Overview

    The problem what do we discuss

    how do we express a problem

    Applications

    Coffee

    Break

    examples of the use of the approach

    To probe deeper

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    3/152

    COSYTEC 3Copyr ight 1995, COSYTEC SA

    Note

    Tutorial with same name at PAP94 Structure is kept

    Methods have changed

    New constraints

    cycle

    more abstraction, more propagation

    machine choice

    setup time problems

    More applications

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    4/152

    COSYTEC 4Copyr ight 1995, COSYTEC SA

    What we will discuss

    Planning, scheduling, assignment Emphasis on detailed scheduling

    Emphasis on constraint

    Modelling techniques se o cons ra n s

    Logic Programming Used as basis

    Alone not sufficient

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    5/152

    COSYTEC 5Copyr ight 1995, COSYTEC SA

    What we will not discuss

    System Considerations Object/Database Design

    Graphical Interface Design

    Quality Assurance

    Methods used inside constraint solvers

    Classical TechniquesAlgorithms

    Strategies

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    6/152

    COSYTEC 6Copyr ight 1995, COSYTEC SA

    Part 1: The problem

    Terminology where we define the different terms and notations

    where we describe different classes of problems

    Classical results where we present different results from Operational

    Research (OR) on scheduling and planning

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    7/152

    COSYTEC 7Copyr ight 1995, COSYTEC SA

    Terminology

    What do we mean by Scheduling

    Assignment

    The main concepts esources

    Tasks

    Jobs

    me Cost

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    8/152

    COSYTEC 8Copyr ight 1995, COSYTEC SA

    Definitions

    (Production) Planning what to produce in which quantity in which period

    period in which quantity

    driven by demand or forecasts

    when to produce

    detailed plan when to start production, when to stop

    (Resource) Assignment how to produce

    which person (machine) will do what at which time

    often on ad hoc basis

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    9/152

    COSYTEC 9Copyr ight 1995, COSYTEC SA

    Resources

    Renewable Typical examples:

    manpower

    Used during t ime period

    Consumable Typical examples:

    raw ma er a money

    utilities

    se at a certa n t me po nt

    Constraints on overall use in a time period

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    10/152

    COSYTEC 10Copyr ight 1995, COSYTEC SA

    Resources (2)Renewable Resource

    tonsuma e esource

    t

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    11/152

    COSYTEC 11Copyr ight 1995, COSYTEC SA

    Tasks

    Elementary operation during time period May or may not use resources

    u resource use

    partial resource use

    Tasks may be split (interrupted) preemptive scheduling

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    12/152

    COSYTEC 12Copyr ight 1995, COSYTEC SA

    Jobs

    Set of tasks belonging together Sequence of tasks may be pre-determined

    prece ence cons ra n s e ween as s

    Jobs often relate to manufacturing of a product or

    an order

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    13/152

    COSYTEC 13Copyr ight 1995, COSYTEC SA

    Time

    Discrete/continuous

    Granularity

    ann ng or zon

    Problem size: number of time points

    1 day 1 week 1 month 1 year

    second 86400 604000 - -

    minute 1440 10800 44640 525600

    shift 3 21 93 1095

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    14/152

    COSYTEC 14Copyr ight 1995, COSYTEC SA

    Time and tasks

    Start Date t i the actual starting t ime of a task

    i the actual end time of a task

    Duration p i Ci-t i

    may vary depending

    on the resource used

    on the start date

    etc

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    15/152

    COSYTEC 15Copyr ight 1995, COSYTEC SA

    Due/release date

    Due Date d i the time when the task should be finished

    i the timepoint after which the task can be started

    These dates may be hard constraints (they must be respected)

    soft constraints (they may be violated at a cost)

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    16/152

    COSYTEC 16Copyr ight 1995, COSYTEC SA

    Earlyness/lateness

    Earlyness the amount of time a task is finished before its due date

    -,

    Lateness Ti the amount of time a task is finished after its due date max , i- i

    Latency q i the period between the end of the task and the end of the

    schedule max(0,Cmax-Ci)

    Setup the time required between two consecutive tasks on the

    same machine

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    17/152

    COSYTEC 17Copyr ight 1995, COSYTEC SA

    Time points and periods

    Graphical view as seen in Gantt charts

    earlyness

    duration

    Resourcesetup

    lateness

    start date end date

    T1 T2

    due daterelease date

    time

    due dateT1,T2 T2 T1

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    18/152

    COSYTEC 18Copyr ight 1995, COSYTEC SA

    Cost

    Overall Enddate Cmax project duration

    Cmax = max{Ci}

    Maximum Lateness Tmax e max mum e ay o a as

    Tmax = max{Ti}

    Sum of Lateness

    a weighted sum of all delays Sum w iTi

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    19/152

    COSYTEC 19Copyr ight 1995, COSYTEC SA

    Cost (2)

    Earlyness indicates stocks of finished products

    0/1 variable indicating delay

    important for jit (100% customer satisfaction)

    Resource Utilization important when resource choice is possible

    cost of changing/cleaning machines

    Machine Downtime t mes w en a resource s e

    Stock Levels

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    20/152

    COSYTEC 20Copyr ight 1995, COSYTEC SA

    Classification

    Comes from OR methodology Classification of pure problems

    Often encountered in reality whenconsidering only main constraints Project Planning

    Machine Shop

    Flow Shop

    Job Shop

    Open Shop

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    21/152

    COSYTEC 21Copyr ight 1995, COSYTEC SA

    Project planning

    Precedence or sequence constraints No resources

    Cost: optimize Cmax

    Very large problem instances (> 10000 tasks)

    ,

    Deterministic algorithms

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    22/152

    COSYTEC 22Copyr ight 1995, COSYTEC SA

    Machine shop

    Characteristics Different resources

    Each tasks requires one resource during its duration

    No choice of resources

    No preemption

    Subclasses:

    ow op Job Shop

    Open Shop

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    23/152

    COSYTEC 23Copyr ight 1995, COSYTEC SA

    Notation

    Shorthand problem notation [n/m/F/D] n jobs

    F; J Type e. g. Flow shop/ Job Shop

    D optimization criteria, e. g. Cmax

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    24/152

    COSYTEC 24Copyr ight 1995, COSYTEC SA

    Flow shop

    Characteristics: Precedence constraints between tasks of a job

    sequence

    duration of tasks on resources may vary

    [n/2/F/Cmax]

    Johnsons algorithm

    max

    polynomial under dominance criteria

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    25/152

    COSYTEC 25Copyr ight 1995, COSYTEC SA

    Job shop

    Characteristics: Precedence constraints between tasks of one job

    Deterministic subclasses

    [n/2/J/Cmax] ac son s ru e

    Job-shop with 2 jobs

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    26/152

    COSYTEC 26Copyr ight 1995, COSYTEC SA

    Open shop

    Characteristics: No precedence constraint between tasks

    Deterministic Subclasses

    [n/2/O/Cmax] onza ez a n a gor m

    Many standard methods do not work due tolack of precedence constraints

    complexity of choice functions

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    27/152

    COSYTEC 27Copyr ight 1995, COSYTEC SA

    Complexity results

    Most machine shop problems are NP-hard difficult problem instances exist

    still, good solutions can be found

    application specific knowledge is useful

    basis for strategies for more complex problems

    Complexity independent of cost function

    research centered on Cmax cost

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    28/152

    COSYTEC 28Copyr ight 1995, COSYTEC SA

    OR techniques

    Linear/Integer Programming

    Heuristic Algorithms

    Decomposition methods Hierarchical

    Structural

    Temporal/spatial

    Branch and bound

    Simulated annealing

    Tabu search

    Relaxation methods

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    29/152

    COSYTEC 29Copyr ight 1995, COSYTEC SA

    Linear/Integer Programming

    Expression of scheduling problems with linear programming

    Often poor result due to non-convexity of

    solution space a n a cos

    deep backtracking

    poor cuts

    Seldom used in practice for detailedscheduling

    planning

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    30/152

    COSYTEC 30Copyr ight 1995, COSYTEC SA

    Heuristic Algorithms

    Progressive building solutions by addingtasks/jobs one at a time

    Good solutions for weakly constrained

    problems Bad results for strongly constrained

    problems

    Heuristics should take constraints intoaccount ynam c, not stat c or er ng

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    31/152

    COSYTEC 31Copyr ight 1995, COSYTEC SA

    Decomposition techniques

    Cut problem into more manageable parts helps handle large/complex problems

    projects and sub-projects

    bottom-up and top-down requ res cer a n pro em s ruc ure

    Structural considering different degrees of freedom independently

    example: separating scheduling/assignment

    Temporal/Spatial

    number of resources

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    32/152

    COSYTEC 32Copyr ight 1995, COSYTEC SA

    Branch and bound

    Create successive sub problems byenumeration on variables

    pruning of branches

    lower bound approximation Standard OR technique

    Search strategies must be defined carefully

    High development effort

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    33/152

    COSYTEC 33Copyr ight 1995, COSYTEC SA

    Neighborhood search

    Search by finding initial solution and improving it

    modification function

    cost evaluation

    steepest ascent

    hill climbing

    s mu a e annea ng

    tabu search

    genetic algori thms

    Local optimization

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    34/152

    COSYTEC 34Copyr ight 1995, COSYTEC SA

    Neighborhood search (2)

    Constraint handling Constraints expressed in cost

    Good for additive costs

    Local changes which improve costs Difficult for very constrained problems

    Finding ini tial solution

    Admissible modifications

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    35/152

    COSYTEC 35Copyr ight 1995, COSYTEC SA

    Relaxation methods

    Solving simpler problem helps findingsolution to complex problems

    Obtain lower/upper bounds

    Initial solutions

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    36/152

    COSYTEC 36Copyr ight 1995, COSYTEC SA

    Importance to CLP

    Defines areas in which CLP approach should(not) be used

    constraint programming

    Application use of techniques Reference results

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    37/152

    COSYTEC 37Copyr ight 1995, COSYTEC SA

    Part II: Methodology

    Constraints: the tools

    Solution approach

    Strategies

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    38/152

    COSYTEC 38Copyr ight 1995, COSYTEC SA

    Constraints and how they work

    Finite Domain Solver based on local consistency techniques

    incremental

    requires enumeration

    based on Simplex method

    complete solver

    so ve orm

    Specialized Solvers (not discussed) Boolean Solver

    List Constraints

    Set Constraints

    COSYTEC

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    39/152

    COSYTEC 39Copyr ight 1995, COSYTEC SA

    Finite domains

    Variables which range over sets of admissible values (integers)

    which link variables and restrict the values which can beassigned to them

    earc ra egy which determine

    the order in which variables are assigned

    the values which they take

    COSYTEC

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    40/152

    COSYTEC 40Copyr ight 1995, COSYTEC SA

    Finite domain basics

    Domain definition

    Numerical constraints nequa y cons ra n s

    Global constraints

    Cumulative Diffn

    Cycle

    COSYTEC

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    41/152

    COSYTEC 41Copyr ight 1995, COSYTEC SA

    Domain definition

    A variable or list of variables are defined

    Different types of domains exist

    Examples X :: 0..100,

    [X1, X2, X3] :: [1,2,4,6,7,11]

    Operations on domains enumerate domain values

    get information about domains

    COSYTEC

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    42/152

    COSYTEC 42Copyr ight 1995, COSYTEC SA

    Inequality constraints

    Link two variables (simple case) example: X #>= Y+10

    consistency technique partial lookahead

    constraint is woken whenever one of the domains change

    constraints) example: X+Y+3*Z #>= T+5*U

    propaga on v a oma n c anges

    generalization of simple case

    COSYTEC

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    43/152

    COSYTEC 43Copyr ight 1995, COSYTEC SA

    Global Constraints

    very high level building blocks

    mix and match combination

    not specialized constraints, but generalconstraints

    COSYTEC

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    44/152

    COSYTEC 44Copyr ight 1995, COSYTEC SA

    Cumulative constraint

    Graphical Introduction cumulative([O1,O2,...],[D1,D2,...],[H1,H2,...], L)

    LHi

    i

    Oi

    COSYTEC

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    45/152

    COSYTEC 45Copyr ight 1995, COSYTEC SA

    Cumulative (2)

    Mathematical Form min = min{Oi}

    = + -

    i [min, max]

    Hj

    L for all j with Oj

    i Oj

    +Dj

    -1

    Global constraint handling ~ 20 different incremental algori thms

    20000 lines in C

    Only most simple form shown here

    COSYTEC

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    46/152

    COSYTEC 46Copyr ight 1995, COSYTEC SA

    Diffn constraint

    Constraint for n-dimensional rectangle

    overlap - -

    space and f it in a n-dimensional area

    Form 11, 12, 13,..., 11, 12, 13,.. ,... , 1, 2,...

    Origin Oij

    Length L ij

    j ij ij

    Useful for 2D placement/ packing

    3D placement/ packing

    Vehicle loading

    COSYTEC

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    47/152

    COSYTEC 47Copyr ight 1995, COSYTEC SA

    Two dimensional placement

    Domain

    Limit

    Obj2

    E2

    Obj1L12

    Obj3O12O32 L11

    E1O11Limit

    COSYTEC 48C i ht 1995 COSYTEC SA

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    48/152

    COSYTEC 48Copyr ight 1995, COSYTEC SA

    Cycle constraint

    Find cycles in directed graphs

    Example: 8 nodes, 3 cycles

    1 3 6

    2 45

    7

    8

    cycle(3,[3,2,6,1,4,5,8,7],...) : cycles written as permutations

    COSYTEC 49Cop r ight 1995 COSYTEC SA

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    49/152

    COSYTEC 49Copyr ight 1995, COSYTEC SA

    Tour generation

    Nodes are cities and resources

    One resource per cycle

    All cities in one cycle are visited by oneresource

    C6

    C1C8

    C7R1

    C4C2 C8 R2

    R3C3

    COSYTEC 50Copyr ight 1995 COSYTEC SA

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    50/152

    50Copyr ight 1995, COSYTEC SA

    Cycle constraint in scheduling

    Nodes = tasks and resources

    Domain variables = successor nodes = next

    Domains = possible successors

    = Weight of nodes = work time of resource

    Special assignment nodes = resources

    Origin of nodes = start times

    COSYTEC 51Copyr ight 1995 COSYTEC SA

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    51/152

    51Copyr ight 1995, COSYTEC SA

    Solution approach

    Expressing scheduling problems with CLP

    Use of the finite domain solver con nuous so ver use or p ann ng pro ems

    Problem statement defines

    Variables Constraints

    Strategy

    expressive power of constraints search concept part of the language

    COSYTEC 52Copyr ight 1995 COSYTEC SA

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    52/152

    52Copyr ight 1995, COSYTEC SA

    Variables

    Decision variables variables correspond to decisions in the schedule

    defines size of domains

    large domain = large search space

    Calendars include/exclude particular dates

    use of explicit domains

    mapping real dates on schedule dates Release/ Due dates

    COSYTEC 53Copyr ight 1995, COSYTEC SA

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    53/152

    Copyr ight 1995, COSYTEC SA

    Example

    Link between calendar and domains

    Calendar

    Monday

    0 2 4 6 8 10 12 14 16 18 20 22 0 2 4 6 8 10 12 14 16 18 20 22

    Tuesday

    Domain (explicit domain)

    Domain (mapping)

    0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30

    COSYTEC 54Copyr ight 1995, COSYTEC SA

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    54/152

    py g ,

    Constraint types in scheduling

    Precedence

    Sequence

    Disjunctive Machines

    Cumulative Machines

    Machine Choice

    Preemption

    Cost

    COSYTEC 55Copyr ight 1995, COSYTEC SA

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    55/152

    Methodology

    How to express different constraints

    Alternative models

    Use of global constraints

    Building blocks for applications

    COSYTEC 56Copyr ight 1995, COSYTEC SA

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    56/152

    Precedence

    One task must be finished before another

    Expressed as inequalities

    Constraints between variables denoting start dates or

    between variables for start and end dates

    task a task b

    Da

    Sb #>= Sa + Da

    a a b

    Sb #>= Ea

    COSYTEC 57Copyr ight 1995, COSYTEC SA

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    57/152

    Sequence

    Sequence constraints l ink start or end dates Start-Start

    -

    End-Start

    End-End

    Efficient handling by constraint propagation but problems with very large sets of constraints

    COSYTEC 58Copyr ight 1995, COSYTEC SA

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    58/152

    examples

    Example problems simple

    not realistic

    CHIP Modelling ac ua co e

    simple structure

    Results

    to help understanding

    Example

    COSYTEC 59Copyr ight 1995, COSYTEC SA

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    59/152

    Project planning

    Simple project example

    B E

    A G

    3

    4 2

    2

    C D F

    3 2 4

    COSYTEC 60Copyr ight 1995, COSYTEC SA

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    60/152

    Modelling

    [Sa,Sb,Sc,Sd,Se,Sf,Sg] :: 0..100,

    [Da,Db,Dc,Dd,De,Df,Dg] = [3,4,3,2,2,4,2],Sb #>= Sa + Da,

    Sc #>= Sa + Da,

    Sd #>= Sb + Db,

    Sd #>= Sc + Dc,Se #>= Sb + Db,

    Sf #>= Sd + Dd,

    Sg #>= Se + De,

    Sg #>= Sf + Df,indomain(Sg),

    labeling([Sa,Sb,Sc,Sd,Se,Sf,Sg]),

    COSYTEC 61Copyr ight 1995, COSYTEC SA

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    61/152

    Project planning results

    Simple project example

    B E

    013

    A G

    3

    4 2

    23 7 9

    C D F

    3 2 4

    COSYTEC 62Copyr ight 1995, COSYTEC SA

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    62/152

    Disjunctive resources

    Constraint HandledA task uses resource exclusively during its duration

    Modelling Constraint as Choices (too weak)

    on ona ropaga on oo wea

    Cumulative constraint

    Alternative Modelling Job sequencing

    COSYTEC 63Copyr ight 1995, COSYTEC SA

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    63/152

    Cumulative formulation

    Express disjunctive with one cumulative

    constraint a, ,.. , a, ,... , , ,... , ,..

    Active use of the constraint

    Recognition of capacity problems available time does not allow all jobs to be scheduled

    bottleneck periods when some jobs have to be scheduled

    possibi lity to link directly with project end via cumulativeconstraint parameter

    Limited interaction with precedenceconstraints

    COSYTEC 64Copyr ight 1995, COSYTEC SA

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    64/152

    Alternative formulation

    Express disjunctive as sequence of tasks on

    a machine

    variable Task_x, value startdate

    variable first task, value task_x

    Classical formulation

    Problem when combining with other (e.g.

    COSYTEC 65Copyr ight 1995, COSYTEC SA

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    65/152

    -

    Example

    COSYTEC 66Copyr ight 1995, COSYTEC SA

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    66/152

    Jobs and tasks

    Job Task Duration Machine

    J1 T11 5 M1

    J2 T21 3 M2

    J2 T23 4 M2

    J4 T41 7 M1

    COSYTEC 67Copyr ight 1995, COSYTEC SA

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    67/152

    Job shop program

    End = 100,

    [T11,T12,T21,T22,T23,T31,T41] :: 0..End,[E1,E2,E3,E4] :: 0..End,

    [D11,D12,D21,D22,D23,D31,D41] = [5,7,3,5,4,5,7],

    T12 #>= T11+D11, T22 #>= T21+D21, T23 #>= T22+D22,E1 #= T12+D12, E2 #= T23+D23,

    E3 #= T31+D31, E4 #= T41+D41,

    cumulative([T11,T22,T41],[D11,D22,D41],[1,1,1],1),

    cumulative([T12,T21,T23,T31],[D12,D21,D23,D31],[1,1,1,1],1),

    min_max(labeling([T11,T12,T21,T22,T23,T31,T41]),

    [E1,E2,E3,E4]),

    COSYTEC 68Copyr ight 1995, COSYTEC SA

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    68/152

    Job shop solution

    Minimize Cmax

    Optimal solution 19

    T21 T31 T12 T23

    5 10 15 20 250

    COSYTEC 69Copyr ight 1995, COSYTEC SA

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    69/152

    Cumulative machines

    Constraint HandledAlternative Machines

    Availability Profiles

    Generalization of disjunctive case

    Constraint Modelling sets of 0/1 variables

    cumulative formulation

    Relation to Machine Assignment

    COSYTEC 70Copyr ight 1995, COSYTEC SA

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    70/152

    Modelling

    Required for each task start date Si

    resource consumption Ri

    Global information vera resource m

    x :: .. ,

    cumulative([Sa, Sb,...],[Da, Db,...],[Ra, Rb,...],Rx,...)

    COSYTEC 71Copyr ight 1995, COSYTEC SA

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    71/152

    Multiple machines

    End = 100,

    [T11,T12,T21,T22,T23,T31,T41] :: 0..End,

    [E1,E2,E3,E4] :: 0..End,

    D11 D12 D21 D22 D23 D31 D41 = 5 7 3 5 4 5 7

    T12 #>= T11+D11, T22 #>= T21+D21, T23 #>= T22+D22,

    E1 #= T12+D12, E2 #= T23+D23,

    E3 #= T31+D31, E4 #= T41+D41,

    cumulative([T11,T22,T41],[D11,D22,D41],[1,1,1],1),

    cumulative([T12,T21,T23,T31],[D12,D21,D23,D31],[1,1,1,1],2),

    min_max(labeling([T11,T12,T21,T22,T23,T31,T41]), [E1,E2,E3,E4]),

    Example

    COSYTEC 72Copyr ight 1995, COSYTEC SA

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    72/152

    Multiple machines

    Two copies of machine 2

    Cumulative solution - not assignment

    Optimal solution cost 17

    5 10 15 20 250

    T21

    T31 T12 T23

    5 10 15 20 250

    COSYTEC 73Copyr ight 1995, COSYTEC SA

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    73/152

    Manpower use

    Job Task Duration Machine Manpowe

    J1 T11 5 M1 2

    J1 T12 7 M2 3

    J2 T21 3 M2 4

    J2 T22 5 M1 3

    J2 T23 4 M2 3

    J3 T31 5 M2 2

    J4 T41 7 M1 4

    COSYTEC 74Copyr ight 1995, COSYTEC SA

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    74/152

    Manpower model

    End = 100,

    [T11,T12,T21,T22,T23,T31,T41] :: 0..End,

    [E1,E2,E3,E4] :: 0..End,

    [D11,D12,D21,D22,D23,D31,D41] = [5,7,3,5,4,5,7],

    Manpower = 6,

    [U11,U12,U21,U22,U23,U31,U41] = [2,3,4,3,3,2,4],T12 #>= T11+D11,T22 #>= T21+D21,T23 #>= T22+D22,

    E1 #= T12+D12,E2 #= T23+D23,E3 #= T31+D31,E4 #= T41+D41,

    cumulative([T11,T22,T41],[D11,D22,D41],[1,1,1],1),

    cumulative([T12,T21,T23,T31],[D12,D21,D23,D31],[1,1,1,1],2),

    Man :: 0..Man ower,

    cumulative([T11,T12,T21,T22,T23,T31,T41],[D11,D12,D21,D22,D23,D31,D41],

    U11 U12 U21 U22 U23 U31 U41 Manmin_max(labeling([T11,T12,T21,T22,T23,T31,T41]),

    [E1,E2,E3,E4]),

    COSYTEC 75Copyr ight 1995, COSYTEC SA

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    75/152

    Manpower result

    Optimum cost 21

    Manpower use 6

    5 10 15 20 250

    T21 T31T12

    T23

    5 10 15 20 250

    COSYTEC 76Copyr ight 1995, COSYTEC SA

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    76/152

    Unavailability

    Handling of availabil ity profiles introduction of fixed dummy tasks

    -

    ummy as s

    profile

    t

    COSYTEC 77Copyr ight 1995, COSYTEC SA

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    77/152

    Relation to assignment

    The cumulative problem states a necessary

    condit ion for solving the assignment problem

    Assignment problem is trivial, if machine

    Typically, assignment can be solved easily, ifa few resource switches are allowed

    If assignment is very important, otherconstraints must be added

    COSYTEC 78Copyr ight 1995, COSYTEC SA

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    78/152

    Consumable resources

    Constraint Handled

    Raw Materials

    Stocks

    Receivings

    Orders

    Idea an e consuma e resources as a spec a ype o

    renewable resource Time points become periods

    from t ime point to end

    COSYTEC 79Copyr ight 1995, COSYTEC SA

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    79/152

    Producer constraint

    Example: Finished Products

    Demand given for fixed time point and fixed

    time points

    quantity required

    Determine the dates when to produce tasks inorder to satisfy demand

    enddate (fixed) quantity produced

    COSYTEC 80Copyr ight 1995, COSYTEC SA

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    80/152

    Consumer constraint

    Example: Raw Materials

    Supply given for fixed time point and fixed

    time points

    quantity required

    Determine the dates when to produce tasks inorder to respect supply

    enddate (fixed) quantity consumed

    COSYTEC 81Copyr ight 1995, COSYTEC SA

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    81/152

    Producer consumer

    Example: Intermediate Products

    Material produced by Producer tasks en a es

    (fixed) quantity

    Material consumed by Consumer tasks start dates

    (fixed) quantity

    Constraint: no negatives

    stoc must e pro uce e ore t s consume

    COSYTEC 82Copyr ight 1995, COSYTEC SA

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    82/152

    Producer consumer (2)

    Producer events are represented by

    tasks from overall start to end of task

    tasks from start of task to overall end

    Resource limit is set as sum of all producedquantit ies + initial stock

    COSYTEC 83Copyr ight 1995, COSYTEC SA

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    83/152

    Cumulative Modelling

    graphical representation of producer/

    consumer constraints

    Supply

    Limit

    u

    (variable)Supply

    (variable)

    Demand

    Stock

    t

    COSYTEC 84Copyr ight 1995, COSYTEC SA

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    84/152

    Product requirements

    ro uce y onsume y

    J1 60 6 60

    J2 70 12 40

    J3 50 21 100

    J4 40

    0 20

    Example

    COSYTEC 85Copyr ight 1995, COSYTEC SA

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    85/152

    Producer model

    End = 100,

    Stock = 20,

    [Q1,Q2,Q3,Q4] = [60,70,50,40],

    Limit :: 0..1000,

    Limit #

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    86/152

    Stock level

    -60 -40 -100

    60

    5 10 15 20 250

    40

    Manpower use

    5 10 15 20 250

    T21T31 T12

    T23

    5 10 15 20 250

    COSYTEC 87Copyr ight 1995, COSYTEC SA

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    87/152

    Stock level

    -60 -40 -100

    60

    5 10 15 20 250

    40

    Demand

    J4

    J2J1

    5 10 15 20 250

    DemandJ3

    Stock

    T21T31 T12

    T23

    5 10 15 20 250

    COSYTEC 88Copyr ight 1995, COSYTEC SA

    E t i

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    88/152

    Extensions

    Variable resource consumption/production

    variable height of rectangles + dummy tasks

    maximum negative stock at any time

    total negative stock*time amount

    use o n erme a e resource m n cumu a ve

    Splitting resource use consumer tasks do not need all material in the beginning

    producer tasks produce some material before the end

    pipelining operations

    jit production

    Safety margins

    COSYTEC 89Copyr ight 1995, COSYTEC SA

    Li it d t k l l

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    89/152

    Limited stock levels

    Problem

    only l imited amount of stocks can be stored

    consumption

    Solution: another call to cumulative

    ea: inverse roles of producer and consumer

    add maximum stock level

    COSYTEC 90Copyr ight 1995, COSYTEC SA

    M hi h i

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    90/152

    Machine choice

    tasks may run on different machines, but may not overlap

    each other each machine is running at most one task at a time

    sets of possible machines for different tasks may overlappartially

    Constraint Handled:Alternative, not equivalent machines

    different speed of machines (different capabil ities)

    machine de endent duration of tasks

    flexible work cells

    COSYTEC 91Copyr ight 1995, COSYTEC SA

    M d lli

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    91/152

    Modelling

    Additional degree of freedom

    dramatic increase of search space

    Machine assignment variable Mi

    element constraint (functional dependencies) link between machine and duration

    element(Mi, [...], p i)

    decide machine assignment beforehand load balancing

    COSYTEC 92Copyr ight 1995, COSYTEC SA

    Non o erlapping constraint

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    92/152

    Non overlapping constraint

    Mathematical Formulation

    for two tasks i and j we have=

    t i >= tj+pj or

    tj >= t i+p i

    Conditional Propagation

    far too weak

    ec ang e acemen

    diffn constraint Redundant cumulative constraint

    e axat on p acement -> cumu at ve

    COSYTEC 93Copyr ight 1995, COSYTEC SA

    Diffn model

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    93/152

    Diffn model

    Constraint expressed as 2D placement

    X-dimension = time Y-dimension = resource

    tasks are rectangles with height 1

    task may be assigned to dif ferent resource

    Duration (variable)

    task ma run at different timeResource

    Start

    COSYTEC 94Copyr ight 1995, COSYTEC SA

    Redundant cumulative

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    94/152

    Redundant cumulative

    Relaxation

    each task has resource use one

    resource limit = number of machines

    cumulative constraint on resource use

    duration of tasks variable

    good for full schedules

    update of time periods of remaining tasks

    Redundant constraint adds reasoning power

    COSYTEC 95Copyr ight 1995, COSYTEC SA

    Machine speed

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    95/152

    Machine speed

    Task M1 M2 M3

    T11 5 3 3T12 7 7 7

    T21 4 3 3

    T22 5 7 7

    T23 4 4 4

    T31 6 5 5

    Example

    COSYTEC 96Copyr ight 1995, COSYTEC SA

    Machine choice model

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    96/152

    Machine choice model

    [M11,M12,M21,M22,M23,M31,M41] :: 1..3,

    machine_duration([M11,M12,M21,M22,M23,M31,M41],[D11,D12,D21,D22,D23,D31,D41],

    [[5,3,3],[7,7,7],[4,3,3],[5,7,7],[4,4,4],[6,5,5],[7,6,6]]),

    , , , , , , , , , , , ,[T22,M22,D22,1],[T23,M23,D23,1], diffn

    constraint

    min_max(labeling([T11,T12,T21,T22,T23,T31,T41,M11,M12,M21,M22,M23,M31,M41]),[E1,E2,E3,E4]),

    COSYTEC 97Copyr ight 1995, COSYTEC SA

    -60 -40 -100

    70

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    97/152

    Stock level

    70

    5 10 15 20 250

    40 50 60

    Manpower use

    5 10 15 20 250

    T11

    T41

    T21 T12

    5 10 15 20 250

    COSYTEC 98Copyr ight 1995, COSYTEC SA

    Sequence dependent setup

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    98/152

    Sequence dependent setup

    Constraint Handled:

    Tooling

    Adjustment Periods

    Constraint Modelling

    yc e cons ra n cu pro ems Diffn constraint (large problems)

    exclusion markers, not discussed here

    COSYTEC 99Copyr ight 1995, COSYTEC SA

    Setup cycles

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    99/152

    Setup cycles

    All tasks on one disjunctive resource form a

    cycle

    successor)

    cycle with minimum weight = minimum setup

    T1 T2 T3R1

    N1 N3N2

    setup1,2 setup2,3

    0

    R1

    COSYTEC 100Copyr ight 1995, COSYTEC SA

    Setup relaxation

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    100/152

    Setup relaxation

    Problem:

    setup depends not just on one task; but on two

    lower bound often zero

    Relaxation of problem:

    gnore se up mes no s gn can e.g. 5 min setup for 2 hour job

    Include setup in duration of task if not sequence

    extend duration of tasks

    Over-estimate setup by worst case assumption

    COSYTEC 101Copyr ight 1995, COSYTEC SA

    setup

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    101/152

    setup

    Constraint Handled:

    Setup on between tasks which are assigned to the samemachine

    Combination with machine choice

    Modelling

    multiple cycles in one constraint

    generalisation of one machine case

    COSYTEC 102Copyr ight 1995, COSYTEC SA

    Preemption

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    102/152

    Preemption

    Constraint Handled:

    Breaks

    Weekend

    Machine dependent calendars

    - Constraint Modelling

    Preemption by Downtime

    e emen cons ra n s

    Inequalities Preemption by task switch

    ara gm sw tc

    COSYTEC 103Copyr ight 1995, COSYTEC SA

    Cost

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    103/152

    Cost

    Cost reporting

    A cost value that should be computed for a solution

    Cost constraintA cost which is handled as a constraint in the search

    p a e ns e e cons ra n propaga on

    Cost approximationA constraint which is not a cost of the application, but

    added to improve pruning in the search

    Different cost constraints have differentsearch behavior

    COSYTEC 104Copyr ight 1995, COSYTEC SA

    Cost: maximum end date

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    104/152

    Cost: maximum end date

    Typical: Overall Project End

    related to machine utilization

    explicit end task

    inequalities

    genera oma n m

    Good cost estimation by constraints

    COSYTEC 105Copyr ight 1995, COSYTEC SA

    Cost: sum of lateness

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    105/152

    Cost: sum of lateness

    Scheduling with due-dates

    Expressed by compu a on o a eness

    constraint approximation

    Ti >= ti+p i - d i

    ar me c cons ra n on we g e sum

    Reasonable cost estimation by constraints added estimate of individual lateness

    Poor propagation from cost limit individual lateness only limited very late in search tree

    COSYTEC 106Copyr ight 1995, COSYTEC SA

    Cost: maximum lateness

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    106/152

    Cost: maximum lateness

    Scheduling with due-dates

    Expressed by compu a on o a eness

    constraint approximation

    Ti >= ti+p i - d i

    nequa es o eac a eness

    Good cost estimation by constraints estimate of individual lateness

    Good propagation from cost limit individual lateness immediately

    COSYTEC 107Copyr ight 1995, COSYTEC SA

    Cost: preferred start date

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    107/152

    Cos p e e ed s a da e

    JIT scheduling

    stock minimization

    Expressed by two variables lateness and earlyness

    eac approx ma e y nequa y

    Restricts domains to (small) intervals good propagation

    possibility of failure

    COSYTEC 108Copyr ight 1995, COSYTEC SA

    Cost: resource usage

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    108/152

    g

    Optimizing factory throughput

    Machine choice Expressed by

    Sum of duration p i

    Use as a strategy run task on fastest machine

    COSYTEC 109Copyr ight 1995, COSYTEC SA

    Cost: stock level

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    109/152

    Stock

    Stock Level

    Stock Volume

    Negatives

    cumulative constraints

    Good estimates intermediate resource levels in cumulative

    Poor propagation from constraint limit

    constraint too restrictive for remaining schedule

    COSYTEC 110Copyr ight 1995, COSYTEC SA

    Strategies

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    110/152

    g

    Need for strategies

    constraint solver not complete (complexity)

    use of domain knowledge (intelligence)

    Heuristic solutions

    n one or ew so u ons w a goo qua y strategy used for finding good solution

    Optimization procedures control search procedure to prove optimality

    strategy used to limit search tree

    COSYTEC 111Copyr ight 1995, COSYTEC SA

    Heuristics

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    111/152

    Degrees of Freedom

    Inside application domain

    relaxation

    decomposition

    variable assignment

    search strategy

    COSYTEC 112Copyr ight 1995, COSYTEC SA

    Co-operation

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    112/152

    p

    Constraints and Heuristics should work

    together

    next choice

    Dynamic heuristics

    choice re-evaluated at each step

    Better than static heuristics

    based only on static picture

    Without constraints heuristic must simulate its effect

    COSYTEC 113Copyr ight 1995, COSYTEC SA

    Assignment strategy

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    113/152

    Choose variable

    Depending on domains of variables

    Depending on heuristics

    Choose value

    se o e res r c e oma n Use of heuristics

    Alternative: Choose set of alternative constraints

    Choose among alternatives

    COSYTEC 114Copyr ight 1995, COSYTEC SA

    Labeling strategy

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    114/152

    Two possible extremes; mixed forms possible

    Value choice e erm n s c c o ce o var a e

    Non-deterministic choice of value

    Variable choice Non-deterministic choice of variable

    Deterministic choice of value

    Deterministic choice of variable

    Deterministic choice of value

    COSYTEC 115Copyr ight 1995, COSYTEC SA

    Value choice

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    115/152

    Often used for CSP problems

    First fail strategy

    Supported by primitives labeling

    e e e indomain

    Typical codelabeling([]).

    labeling([H|T]):-delete(X,[H|T],R,0,first_fail),

    indomain(X),

    labeling(R).

    COSYTEC 116Copyr ight 1995, COSYTEC SA

    Variable choice

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    116/152

    Often used in OR methods

    Left-most strategy

    all other tasks do not start earlier

    on backtracking, try another variable

    Simple example delete/3

    delete(X,[X|R],R).

    e e e , , :-

    delete(X,R,S). Support by primitives

    delete/5

    domain_info

    COSYTEC 117Copyr ight 1995, COSYTEC SA

    Redundant constraints

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    117/152

    Add constraint to improve reasoning

    Consequence of incomplete solver

    Add constraints to restrict admissiblesolutions

    reng en cons ra n s Find only one solution, not all

    Relaxation techniques

    COSYTEC 118Copyr ight 1995, COSYTEC SA

    Optimization

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    118/152

    Search trees

    Search space

    Sub tree

    Choice points

    Improved

    Solutions

    Initial

    Solution

    COSYTEC 119Copyr ight 1995, COSYTEC SA

    Importance of lower bounds

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    119/152

    Cut parts of search tree

    Complete enumeration impossible

    cost The better the cost estimate, the earl ier we can prune the

    Depends on cost function and constraints The pruning of the constraints may help to find good cost

    Avoid additive costs No direct influence between local decision and global

    cos

    COSYTEC 120Copyr ight 1995, COSYTEC SA

    Partial optimization

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    120/152

    Not always necessary to explore completesearch tree

    Imprecise data

    Allow limited optimization around good

    Consider only one or two alternatives at each choicepoint

    Consider decomposition to optimize subproblems

    COSYTEC 121Copyr ight 1995, COSYTEC SA

    Methodology summary

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    121/152

    Modelling of scheduling problems withconstraints

    cumulative

    diffn

    cyc e Mixing of constraints

    toolbox

    incremental problem Modelling

    Role of strategies

    optimisation

    COSYTEC 122Copyr ight 1995, COSYTEC SA

    Part III: Applications

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    122/152

    Benchmarks and their limits

    ATLAS Other examples

    COSYTEC 123Copyr ight 1995, COSYTEC SA

    Benchmark problems

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    123/152

    Bridge Project planning with resource constraints

    Difficul t job-shop

    Patterson 110 cumulative problems

    Alvarez

    COSYTEC 124Copyr ight 1995, COSYTEC SA

    Limits of benchmarks

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    124/152

    Pure problems Non incremental techniques

    Number of problem instances Over-specializing methods

    eur s cs oo par cu ar Performance measures

    Number of backtrack points

    Run time

    Problem sizes

    2

    COSYTEC 125Copyr ight 1995, COSYTEC SA

    ATLAS

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    125/152

    Scheduling system in chemical factory herbicide manufacturing and packaging

    Live system first phase operational since July 93

    secon p ase opera ona s nce arc Developed jointly by

    Beyers & Partners

    COSYTEC

    Multi-user PC/UNIX system

    co-operative behavior

    COSYTEC 126Copyr ight 1995, COSYTEC SA

    The process

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    126/152

    F1L1

    F2

    L3

    L2

    F3 L4Area

    F4

    F5L6

    Formulation Storage Canning Outside

    Canning

    Container

    Storage

    COSYTEC 127Copyr ight 1995, COSYTEC SA

    Batch part

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    127/152

    Herbicide formulation

    Main constraints eren pro uc on mes or resources

    typical 4-8 hours

    Batch sizes between min and max limits

    e.g. o ers no smaller batches allowed

    Product dependent setup

    very ong compare o pro uc on me

    Limited choice of resources

    Very l imited storage capacity

    typ ca atc

    Exceptional use of auxiliary storage

    COSYTEC 128Copyr ight 1995, COSYTEC SA

    Packaging part

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    128/152

    Fill ing of product into containers of differentsizes .

    Packaging lines vary in capabil ity Speed

    a er a an e Setup

    Manpower required

    Outside packaging scheduled manually

    But taken into account for stocks and materials Operation can not be automated

    COSYTEC 129Copyr ight 1995, COSYTEC SA

    The system

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    129/152

    Connection to other systems Data download/upload from/to local and remote

    mainframes

    End-user connection via PCs

    Data base

    ORACLE SQL standard

    Forms/reports facilities

    u -user oo

    Multiple schedulers for parts of production Inventory control

    Production

    Multiple scenarios; one schedule

    COSYTEC 130Copyr ight 1995, COSYTEC SA

    System integration

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    130/152

    - IBM - VMSSAS

    X25

    HP 9000

    Oracle

    PCEthernet

    COSYTEC 131Copyr ight 1995, COSYTEC SA

    Graphical interface

    Diff t i i t d t

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    131/152

    Different views into data Graphical/textual display of information

    Moving tasks in t ime and on resources

    Checks on constraints

    Control on manual modificationsAllows constraint violations

    User can modify/change schedule at any time

    COSYTEC 132Copyr ight 1995, COSYTEC SA

    Views into data

    Diff t i f d t

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    132/152

    Different views of data Gantt

    Orders

    Finished Products

    Raw Material

    COSYTEC 133Copyr ight 1995, COSYTEC SA

    Constraint solver

    C t i t h dl d

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    133/152

    Constraints handled Machine choice

    Manpower limits

    Component consumer constraints

    Producer/consumer constraints for intermediate products

    Production planning for batch part

    Optimum batch sizing

    Limited stock levels

    COSYTEC 134Copyr ight 1995, COSYTEC SA

    Machine choice

    Tasks can be run on different lines

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    134/152

    Tasks can be run on different lines Different production rates

    Different setups

    Heuristic choice of preference to fastest line

    Offset by need to keep l ines busy

    COSYTEC 135Copyr ight 1995, COSYTEC SA

    Setup

    Setup depends on characteristics of products

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    135/152

    Setup depends on characteristics of products Bottles

    Formulated product

    Setup varies very much

    o re axa on poss e Choice influences overall throughput

    Conflict with due dates

    Uses strategy to minimize setup close to (theoretical) optimum

    COSYTEC 136Copyr ight 1995, COSYTEC SA

    Components

    Component availabil ity required for

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    136/152

    Component availabil ity required forproduction

    Frequent changes in BOM BOM local to task

    Constrains schedule up to lead time ofcomponent Typical up to three weeks

    Delivery of material known up to lead time Delivery

    Material orders

    COSYTEC 137Copyr ight 1995, COSYTEC SA

    Components (2)

    Tasks consume stocks on certain time points

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    137/152

    Tasks consume stocks on certain time points Not all material must be available at start date

    Large increase of constraint size

    Consumer constraint on consumable

    Simple forms can be replaced by inequalities

    COSYTEC 138Copyr ight 1995, COSYTEC SA

    Finished products

    Known delivery dates of finished products

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    138/152

    Known delivery dates of finished products Orders of fixed quantity

    Data reconci liation problem

    Finished product available before end of

    tasks Handled on a per day /shift basis

    Increases problem size

    Important to minimize stock levels

    Producer constraint with cumulative

    COSYTEC 139Copyr ight 1995, COSYTEC SA

    Formulated product

    Producer consumer constraint between

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    139/152

    Producer consumer constraint between Batch formulation (producer)

    Fixed parts: stocks, transfers, material orders etc

    Limited overlap possible a c es are ava a e a en o ormu a on

    canning tasks do not need all product at start date

    Batch size dependent on actual use

    COSYTEC 140Copyr ight 1995, COSYTEC SA

    Manpower

    Manpower limits given from database

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    140/152

    Manpower limits given from database Presented on per shif t basis

    of tasks Depends on canning line chosen

    u oma e nes

    Manual lines

    Additional manpower limits on number oflines in operation

    Supervisors/technicians

    COSYTEC 141Copyr ight 1995, COSYTEC SA

    Production planning

    Tasks for canning lines given from database

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    141/152

    Tasks for canning lines given from database Related to orders/sales forecasts

    Tasks for formulation generated by system Number of batches determined by system

    c e u e n ma n sc e u er

    Separate phase to tune batch sizes

    COSYTEC 142Copyr ight 1995, COSYTEC SA

    Multiple scenarios

    Possibi lity to store/recall/delete multiple

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    142/152

    y pscenarios

    Exchange of proposed solutions betweenoperators

    What-if evaluation Comparison manual/automated scheduler

    COSYTEC 143Copyr ight 1995, COSYTEC SA

    Quality indicators

    Orders too late

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    143/152

    Tasks too late Tasks too early

    Stock level

    Production rate

    Setup periods/duration/manpower

    Cleaning time/ resources

    COSYTEC 144Copyr ight 1995, COSYTEC SA

    ATLAS - Summary

    End-user system

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    144/152

    y Direct manipulation

    Changes/strategies expressed via interface

    Complex scheduling problem ea - e, no pure pro em

    Interaction/conflicts between constraints

    Incremental expression with constraints

    Significant development effort

    Integration Data base reporting

    Graphical interface

    Problem solver

    COSYTEC 145Copyr ight 1995, COSYTEC SA

    Other applications

    HIT (ICL)

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    145/152

    Scheduling/assignment for container harbor

    Planning/scheduling of mail sorting

    PLANE (Dassault Aviation)

    Production line scheduling

    Workshop scheduler (Dassault Aviation)

    Saveplan (Sligos) MRP scheduling package

    PROTOS (BIM, Hoechst, IBM, Sandoz) Scheduling project for chemical industry

    COSYTEC 146Copyr ight 1995, COSYTEC SA

    Applications (2)

    CPLAN (COSYTEC)

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    146/152

    Toolbox for resource restricted project planning

    Scheduling planning/simulation for refineries

    APACHE (COSYTEC)

    Assignment for airport stand allocation

    PILOT (SAS Data/COSYTEC)

    EVA (EDF/GIST) Transport schedule for nuclear fuel

    TACT (COSYTEC) Transport schedule in food industry

    COSYTEC 147Copyr ight 1995, COSYTEC SA

    Part IV: to probe deeper

    Comparison

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    147/152

    Pitfalls Part of the development process

    References

    COSYTEC 148Copyr ight 1995, COSYTEC SA

    ompar son

    Alternative MethodsOR t h i

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    148/152

    OR techniques

    Heuristic approach

    Iterative Improvement

    Evaluation Criteria

    Expertise

    Efficiency

    COSYTEC 149Copyr ight 1995, COSYTEC SA

    When to use constraints Hard Problems

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    149/152

    Admissible solutions are not obvious

    Strong interaction of different constraints

    Local Costs os s are expresse oca y, no g o a y

    Lower bound estimated by constraints

    Strategies are important User knowledge can be included

    No blind search for an optimum

    COSYTEC 150Copyr ight 1995, COSYTEC SA

    Pitfalls Modeling Everything

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    150/152

    Constraints must constrain

    Soft/Hard Constraints Soft constraints do not help

    ar m s e n so ones

    Optimization with imprecise data Influence on problem size

    Theoretical vs practical optimum

    KISS principle applies ,

    COSYTEC 151Copyr ight 1995, COSYTEC SA

    Relative importance of solver Percentage of design

    S l t b t k i t t d i d i

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    151/152

    Solver must be taken into account during design

    Percentage of development Often small compared to integration work

    uccess no guaran ee

    Prototyping

    Experiments early in development cycle

    e a ve y g r s compare o o er eve opmen

    Importance to overall acceptance Solver alone is not enough

    Without solver the rest is not useful

    COSYTEC 152Copyr ight 1995, COSYTEC SA

    References References for the areas

    C t i t th d

  • 7/21/2019 Scheduling and Planning With Constraint Logic Programming

    152/152

    Constraint methods

    Applications of CLP

    CLP systems

    Other constraint tutorials

    Presentations at PAP 95