38
Constraint-Based Scheduling in the Real World Mark Boddy Honeywell Laboratories [email protected]

Constraint-Based Scheduling in the Real World Mark Boddy Honeywell Laboratories [email protected]

  • View
    216

  • Download
    0

Embed Size (px)

Citation preview

Constraint-Based Scheduling in the Real World

Mark Boddy

Honeywell Laboratories

[email protected]

Outline

• Crude oil scheduling demo (first example)

• Discussion of scheduling problems

• Constraint-based scheduling

• Avionics scheduling (second example)

• Some (very) open questions and irresponsible remarks

Finite-Capacity Scheduling

Specify activities linked to operations (transfers, tool changes, delivery dates, production runs, etc.).

This specification includes:

–Activity start and end times

–Resource usage, including raw materials, power, equipment needed, labor required

Finite capacity schedules can be used to determine predicted inventory levels, campaign completion/product delivery dates, economic performance, unit operating modes, and resource bottlenecks.

Complex Operational Domains

Air Transportation Satellite Operations Autonomous Vehicles

Continuous MfgDiscrete MfgLogistics

Crude Oil Scheduling Demo

Another view of the problem

Time

ProductVolume

Value of Scheduling for Manufacturing

• Reduce Costs

– Reduce disruption frequency and severity (what-if scenarios, detailed maintenance schedules)

– Improve parts/raw material ordering (better tracking of on-hand inventory)

– Reduce Work-In-Process inventory (reduced lot-rot, more timely vendor ordering, better synchronization of production to delivery dates)

– Reduce changeover costs (cleaning, new catalyst, temperature changes, …).

• Enhance Capital Investment Planning

– prioritize and quantify payoff for capital investment

• Increase Effective Capacity

– Identify and remove bottlenecks

– Increase agility (improve “Available to Promise”)

Determining when and how to accomplish some set of tasks.

The classic job shop:• A set J of jobs to be run, each with• a set of tasks to run in sequence, each on some unique

element of• a set M of machines

Common problem statements:• Find a feasible schedule.• Minimize makespan.• Given a set of deadlines, minimize tardiness.

What is Scheduling?

Ti

Possible Complications (a brief sample)

• Choice of resource• Other resource constraints

– (Global) capacity constraints– Inter-activity constraints– Consumable resources

• Complex temporal constraints (latency, preemption, hierarchical activity relationships).

• System dynamics (flow rates, chemical composition, …)

• Activity generation• Reasoning about state

Manufacturing IT Architecture

Strategic Planning

ProductionPlanning

Finite-capacityPlant scheduling

Manufacturing Execution

Distribution

Capital investment, Finance, Long-term supply and demand forecasts

Rough-cut capacity planning, Orders forecasts,Long-leadtime vendor orders

Transportation andWarehouse ManagementVendor orders

Receiving

More than 6 months

1 month to 1 year

2 weeks to 3 months

1 day to 1 month

1 hour to 1 day

Rough-cut Scheduling(Bill of Materials)

MRP-II

How schedules are used is a factor as well

• Schedules are generated to satisfy existing plans.• Schedules are generated in a historical context.• Schedules are usually not constructed completely

automatically.• Schedules frequently require input from multiple parties.• Schedules are used in operations.

– Updating, as events occur.– Rescheduling, as conflicts are detected.– Post mortem examinations.

• (Schedules are persistent artifacts.)• Schedules are large.• Optimization is important, but hard to formalize properly.

Scheduling as a Constraint Satisfaction Problem

CSPs are specified as:– A set V of variables– A set C of constraints, each constraint a relation

specifying tuples of permissible values for some subset of V.

The objective is to find a feasible (alt., optimal) complete assignment for V, consistent with C.

Advantages to a CSP approach

• Flexible, declarative representation.• Lots of previous and current work on solution

methods.• General solution techniques:

– Static structural analysis– Propagation– Search

• Requirements and scheduling decisions can be represented as constraints.

Scheduling as Search Using a Dynamic CSP

CSP Variables:– Activity start and end times– Activity resource assignments

Constraints:– Temporal constraints (duration, ordering, release times,

deadlines, …)– Resource constraints (permissible assignments, usage

requirements, state information, ...)– System dynamics (rate limitations, allowable state

changes, …)

Search over:– Activity generation– Resource assignments– Activity orderings, start and end times

Hybrid Systems

Hybrid systems have both continuous and discrete components, as opposed to:– Combinatorial problems, such as knapsack,

TSP, or jobshop– Continuous problems, captured as sets of

mathematical equations and inequalities.

Combinatorial, continuous, and hybrid constraint problems can all be framed in terms of either satisfiability (CSP) or optimality (COP).

Scheduling is a hybrid constraint problem.

Constraint Envelope Scheduling

Search variables:– Unary resources: < A before B, B before A >– Capacity resources: < A before B, B before A, A overlaps B >

A1

A2

A3

A1 A2A3

CES Solver Architecture

Discrete Constraint Engine

ContinuousConstraint Engine

1. Continuous constraints added as result of discrete decisions

2. Continuous constraint propagation and consistency check.

2.a. Propagation of additional constraints to discrete engine2.b. Propagation of additional constraints to continuous engine, repeat 2.a, 2.b as needed/desired

3. Discrete constraints added as result of continuous decisions

4. Discrete constraint propagation and consistency check.

4.a. Propagation of additional constraints to continuous engine4.b. Propagation of additional constraints to discrete engine,

repeat 4.a, 4.b as needed/desired

Data structures: Discrete Model

• Discrete variable– Legal values– Current constraints on assignable values– Cross-domain constraints: constraints to be added to continuous

domain, depending on value assigned to this variable.

• Discrete Constraint– n-ary relation on discrete-valued variables (legal combinations of

values)– Constraint type: REQUIREMENT, DECISION, PROPAGATION

EFFECT– Culprit Identification bookkeeping (Decision variable(s)

responsible for this constraint being added).– Propagation method(s)

Data structures: continuous model

• Continuous variable– Current constraints

• Continuous Constraint– Mathematical relation (=, <=, etc.) on several variables– Constraint type: REQUIREMENT, DECISION,

PROPAGATION EFFECT– Culprit Identification bookkeeping (Decision variable(s)

responsible for this constraint being added).– Propagation method(s)

Constraint Envelope Scheduling

Advantages:– No premature commitment– Flexible search strategies– Natural representation for decisions (“do it before lunch”)– Natural interleaving of search and propagation

Disadvantages:– (Somewhat) cumbersome to implement.– Intermediate results are less intuitive to users (more difficult

to present, anyway).– Efficiency concerns (a matter of degree…)

CES vs. Timeline Scheduling

• Activity times and resource usage are precisely specified, if activities appear on the schedule at all, vs.

• Activity extent and resource usage may be incrementally constrained.

The first assumption makes propagation difficult.

The second assumption can get you into trouble in a number of ways:– excessive (and potentially irrelevant) bookkeeping– decisions made in a context that is then invalidated (Andy

Baker’s “Hazards of Fancy Backtracking”).

More Tradeoffs

• Constraints are checked when activities are added to the schedule, vs.

• Constraints are accumulated as scheduling progresses

The first assumption makes incremental rescheduling difficult, throws away information about how the schedule got to its current state.

Under the second assumption, you can accumulate a lot of constraints. Most of them may be subsumed by other constraints, but employing any kind of backtracking search will require that they are maintained in some form.

Implementing a Generic Scheduling Core

• Generic CSP support– variables and constraints– propagation– search

• Continuous model for temporal constraints

• Activities

• Resources

• Resource requirements

Activities

• Interval– temporal constraints, in the

Interval Constraint Engine (ICE)

• Resource requirements

• Hierarchical activities

• Container activities

Interval Constraint Engine (ICE)

A graph of time points, with labeled edges between them.

• Possible temporal relationships:– Release time and deadline (relative to a clock)– Min/max duration– Precedence (minimum separation)– Latency (maximum separation)

• Ordering decisions and start/end time assignments are added as constraints.

• ICE maintains global consistency, reports infeasible (negative-weight) cycles.

Resources

• Unary Resource (manufacturing cell)

• Metric Resource (power)

• Capacity resource (energy)

• State resource (material service)– state-using activities– state-changing activities

Upper and Lower Bounds on Resource Use

Generalized Bounds

Bounds based on temporal constraints are only part of the problem:– Activities on/off the schedule.– Resource choices unconstrained or partially

constrained.– Imprecise usage by individual activities

Resource Requirements

• Match:– by name– by type– by attribute– by procedural attachment

• Effect– metric resource is busy– capacity resource is consumed (or

produced) at a constant rate.– state resource is changed (or not).

Effective Domain Modeling is Hard

Example: large transport pipelines

• Pipeline volume must be modelled explicitly (not like shipping and receiving).

• Currently model is to have slugs of material with associated volume, etc., plus a position in the pipeline.

• Material movement in the pipeline requires both input and output flows.

• Rate is independent of individual movements

Boeing 777 AIMS Scheduling

SAFEbus Scheduler for Boeing 777 AIMS

AIMS requirements represent one of the largest, most comprehensive sets of constraints ever successfully scheduled:

• 29,000 items are scheduled, subject to 97,000 complex metric constraints specified by AIMS applications developers

• More than 230,000 decisions, each with between 4 and 4,000 possible choices were made in scheduling

• This corresponds to finding a solution with a directed search of 107 elements in a state space of 10140000.

Processor Schedule

Data Schedule

How We Solved It

Ginsberg’s “Dynamic Backtracking” algorithm

• Published in 1994

• We fixed a bug

• We extended it

Moral: sometimes the path from research to product takes months, not years.

Scheduling: The Current State of the Art

“Current state of the art” Issues:–60% of manufacturing facilities have no automated scheduling capability.

–30% of airline flights don’t go as planned, on a good day.

–10% reduction in waiting time for trucking industry would allow 6% of all trucks to be taken off the highways altogether.

–Most current scheduling done by unsophisticated means - spreadsheets or manually.

Gaps to be closed by an Integrated Solution:

1) Schedule awareness and editing, then…

2) Autogeneration of feasible schedules, then…

3) Autogeneration of optimal schedules.

Most manufacturing enterprises do not have an effective solution to

address Step 1!

Most manufacturing enterprises do not have an effective solution to

address Step 1!

Scheduling Systems are 95% Boring

PRM

Config

Plan

ExtSched

Plant

ActivityHist

WorkingSchedule

Scheduler

PlanningTool

Marketing

Plant Model

Plant Historian

MES

External Data Interchange

PublishedSchedule

ArchivedSchedule

Scheduling UI

Publish

Archive

DataExternallyAccessible

External Data Interchange

Areas for Further (Interesting!) Work

• Optimal Scheduling (for the right definition of “optimal”)

• Incorporating probabilities

• Robust schedules vs. responsive schedulers

• Moving up into production planning

• Better integration with action selection and states