The CLP Approach to Solve a Scheduling Application - CiteSeerX

2 downloads 0 Views 49KB Size Report
generate-and-teststrategy of the LP. The first representative of this approach w as the finite ... problems, such as job scheduling in factories, resource allocation, ...
The CLP Approach toSolve aSchedulingApplication Jan Paralic, JuliusCsonto Dept. of CyberneticsandArtificialIntelligence TechnicalUniversity oKošice f Letná9041 , 20Košice, SLOVAKIA {paralic,csonto}@ccsun.tuke.sk Abstract Thispaper describesour latestresultswhich waechieved bsyolving naottypical scheduling applicationusing CLP(ConstraintLogic Programming) approa ch. The problemisa partof m a ore complexcontrolsystemfor the pushfurnacesin the VSŽ a.s. (the biggestSlovak metallurgy company).Inthe pushfurnacesthe slabsmustbe heated otn he righttemperature before rolling themonthe wide-strip rolling mill.By optimalorder ing oslabs f in push furnaces better heating processaswellassignificantenergy savingscan baechieved. Inour paper basic principlesof CLPandone oits funderlying paradigm s constraint solving are briefly describedand summarisedifnirsttwo secti ons. The technologicalprocessand the probleminquestionare describedinSection3andour solution based otnhe CLPapproach is precisely analysedinSection4Finally, . the evaluation oour f result and s some future stepsare sketchedinSection5.

Keywords constraintlogic programming, constraintsolving, scheduling, push furnace,

slab

1. ConstraintLogic Programming CLPipasrogramming paradigmwhichextendslogic programming ( ways(see Fig.1tounderstand the origin CLP of fromtwoparentpa solving ). Firstly,there were attemptstoincorporate semantic objects ustouse more effective algorithmstomanipulate withthem. These calledCLP(X) scheme (incrementallinear solving branch in Fig. formulatedin(Jaffar andLassez, 1987) andconsequently implemented otnhe domaininthe CLP(R) system(Jaffar etal.,1992). Secondly,there were attemptstoovercome the wellknown performance generate-and-teststrategy othe f LP.The firstrepresentative othis f approach w domainpartof the CHIPsystem(Dincbasetal.,1988). The key aspect between deterministic a process,constraintevaluation, and nondetermi a (domaintechnology branchinFig.1).

LP) in two different radigms LP - and constraint inside LP, which would enable attemptsresulted itnhe so 1), which wastheoretically realarithmetic problemsof the asthe finite here itasightintegration nistic process, search

Twodifferentapproachesresultedintwodifferenttechnologiesused inside existing CLP systems(depictedatwo s differentbranchesstemmed fromthe node CLPiF n ig. 1) In .both cases,notonly expressivenessof the resultedCLPlanguage butals tohe efficiency ihighly s improveddue tothe underlying constraintsolving techniques (see Section 2). CHIPwas fairstandmostinnovative prototype implementing both abovem entioned CLP technologies.Itwasinitially developedinanindustriallaboratory, t he ECRC(European Computer-Industry Research Centre) basedinMunich (Germany). Thise venttriggered much of whathasfollowedinthisarea.Since the beginning onineties f caoupl oecommercial f CLPtools have beenreleased.BesidesCHIPVt4here are currently DECISI ONPOWER, Prolog III, SNI Prolog,ILOG or BNRProlog each othem f being already successfull uysed for seriousindustrial applications.There are many more CLPsystems(CLP(R), ECLiP Se, CAL, clp(FD) to name a few) usedmore lessfor researchpurposes(some othem f going tboe commercialised). CLPpotentialliesinitspower totackle difficultcombinatorial problems, such ajob s scheduling ifnactories,resource allocation,placementproblems, producti on planning and many more.The applicability othe f CLPapproachhasalready been proven being used blyarge corporations,including manufacturersasDassaultAviation (scheduling a nd planning) or Renault (planning andcar sequencing).

LOGIC PROGRAMMING

CONSTRAINTSOLVING • declarative problem statement • variables • constraints

• basedonunification • syntacticalmanipulationwith uninterpretedstructures • generate & test

CONSTRINTLOGIC PROGRAMMING

• basedonextendedunification • semantic objects • constrain& generate

DomainTechnology

• variableshave finite domains • localpropagationtechniques • incomplete solvers Fig.1

• attributed variables • basic constraints • user-defined constraints

IncrementalLinear Solving

• real(rational) arithmetic • Simplex-like algorithms • complete solver

Twoparentparadigmsof CLPand two technologiesin CLP

2. ConstraintSolving Thissectionpresentsthe basicsof the CSawell s asthe tw are providedbtyhe CLPsystems.There are twobasic principlesunde constraintlanguages(Cras, 1993): 1. Declarative Problem Statement: Variablesand Constraints The firststepinexpressing problem a consistsinidentifyi These are unknowns,for whichww e anttofindacceptable values. As problem.

solving o technologieswhich rlying CSapresented s in

ng set a of

constrained variables . sume the following toy

Example can I see H headsand Llegs.How many horsesare there, and how many men ? Inour toy problemthere are four constraintvariables: H number of heads number Lof legs K number of horses,and M number of men The secondstepito sdefine constraintson these variables. A constraintis raelation of any kind thatmustholdonce the variable hasreceived value, a in order that saolution ttohe problemisacceptable. Inour toy problemwe have the following c onstraints: H = M+ K L= 2*M+ 4*K 2.IncrementalDeduction:Active Constraints, Solversand Consistency A lgorithms The secondprinciple can bexpressedinanother way thatinforma tion supplied btyhe constraintshelpsusdetectinconsistenciesassoon apossible s thus - preventing unnecessary search.The mechanismby whichthisisachievedithe s active constraint which inot s only seen as paartof the problemdefinition,butitalsoworksas paroce duralcomponentthatensuresthe relationirepresents t remainssatisfied. The way active constraintsworkdiffersfromtoolto tool, butin al cases l the idea ito s associate constraint a or garoup oconstraints f withsome incrementalsolver pa,iece of software whose functioniisto tdeduce informationaboutthe varia blesin the constraint(s) with whichiisassociated. t The algorithmused bconstraint ay solver iscalled consistency algorithm Such . kind of algorithmsare incrementalin the sense thatthey canbre erun alow t costeach time "something" changes,inorder todeduce the additionalinformation re sulting fromthe change. There are twomainapproaches: incrementallinearsolving and domain technology .

2.1Domain Technology The domain ovafariable ithe s setof possible valuesitcan take. Thisis atthe same time caommunicationchannelfor differentconstraintswhich share the sam veariable. Thisisthe basic idea behinddomaintechnology. A constraintis(re)activatedeachtime significant a change occursin the domain ionne of itsvariables,anditsexecutionmay leadtcohangesinthe domains of some other variables. This may thenleadtothe (re)activationoother f constraints,resulting in aenffectknown as constraint propagation. A significantsubsetof thisapproachithe s finite domain technology In .thisdomain approach,reasoning iin sgeneraldecentralisedinthatthere ione s solver per non elementary constraint.

2.2Incremental LinearSolving Inthiscase solver a isattached notto single a constraintbut to group a olinear f constraintswhichare typically maintainedduring computation ikind an of solved form. The Simplex-like algorithmisusedeachtime new a linear equa tion (inequality) isadded tothe systemtoprove the consistency othe f systemas w a hole. The mainadvantage othis f approachcompared ttohe domain technology, when both are applicable,isthatSimplex-like algorithmdetectsglobalinconsis tencieswithin linear a system almostimmediately,whereasdomain-based solversare in mostcas esincomplete and may detect the globalinconsistenciesonly when searchstarts(constraintpropag ation phase inot s powerful enough).

3. Technologicalprocess Inthissectionthe technology related tothe problemwe have been sol describedawell s asthe task itself. VSŽ a.s.isthe largestmetallurgy company inthe Slovak republic productiontechnology oits fmaindaughter company Oce¾s.r.o. to continuoussla ZPO 1and2and , the gradualdecommissionothe f slabbing operation, and furthe reductionocosts f onheating inpushfurnaces(NP) by utilisation ohig f charge,butespecially btyhe change inproductionphilosophy athe t hotwide (TSP1700) under conditionsof marketeconomy,i.e. to maximally satisfy customersrepresentedbm y eansof orders,delivery times, quality a foundthe main motivesfor the modelpreparationfor automation and co-ordinat operative plansatZPO,NPandTSP(Malindžák,1993).

ving using CLPis The . change in cbasting at rmore, the her volumesof hot -strip rolling mill the requirementsof nd volumes, in these can be ion othe f

3.1Description oMaterial f Flow A scheme othe f materialflow isdepictedinFig.2. (Malindžák, 1993) In .the two continuouscastingmachines (ZPO 1, ZPO 2) slabsof required dimensionsare castled. Castled slabsadvance either tothe slabsfinishingplant and cold storage or in directsequence for heating

intoone of four existing pushfurnaces (NP1 to NP4). After heating the slabsare pushed out fromthe pushfurnacesandcontinue rolling onthe wide-strip rolling mill (TSP1700). A field storage servestomake utphe balance odifferences f in production and regular maintenance repairsof TSP1700oat rlonger down-time oZPO f 1oZPO r 2. CONTINUOUSSLAB CASTING (ZPO 2)

CONTINUOUSSLAB CASTING (ZPO 1)

WARMSTORE

WARMSTORE

SLABBING SLABSFINISHING PLANT

COLDSTORE

FIELDSTORE

PUSH FURNACE 1. (NP1)

PUSH FURNACE 2. (NP2)

PUSH FURNACE 3. (NP3)

PUSH FURNACE 4. (NP4)

WIDE-STRIPROLLING MILL (TSP1700)

Fig.2

Scheme of

materialflow atthe section ZPO

NP TSP -

3.2Goals ofOperativePlanning The change inproductiontechnology acompany t continuouscasting oslabs f atZPO 1andZPO 2,withthe perspective of service andmaximumefforttoadapttomarketandcustomershasra solution(Malindžák,1993). a)Maximally satisfy termrequirementsof customers, repres of delivery andorderedamountfor one week.. b)Co-ordinate the productionplansof TSP,NP, ZPO so, thatthe highest slabsindirectsequence were reached, andbtyhisto solve the diff of finishing plantfor slabsandthe productionoZPO f 1and ZPO 2. c)Btyhe organisationomaterial f flow and boyperative planning of for heating othe f slabsinNP. Inthe following ww e illfocusonly otnhe partrepresented bpyush fur goalof our CLPbasedsystem.More detailsaboutco-ordination oplans f mentionedtightly coupledpartsof technology aOce¾ t s.r.o. can bfeound in

Oce¾with respectto the transition to slabbing putting outof ised the following goalsfor ented boyrdersand keeping the term possible percentage of erence between the capacity NPtroeach energy savings naceswhich ithe s on the three above(Malindžák, 1993).

3.3Task Description Our taskito sschedule slabsfromvarioussourcesinto push furnaces for heating before rolling ontothe hotwide-strip rolling mill.Order of slabsatthe outputof the push furnaces, i.e. the actualorder for the rolling (socalled production schedule isfixed, ) based otnhe rulesof technology,experiencesof planners-logists, actualordersand state of stores. The maingoalsof the controlsystemfor the push furnacesfor the appropriate organisationoslabs f pushed intothe furnacesand optimalheating inside furnacesare: • toimprove the quality oslab f heating, • tominimise the energy consumptionfor heating slabs, and • toreduce the metaloverburning. The inputfor our task ithe s abovementioned production schedule which specifiesthe requiredorder of slabswithparticular size andquality athe t output of the push furnaces(i.e. their order for the hotwide-striprolling mill). The aimof our workito suse the CLPapproachtaochieve the same resultsand compare bothapproacheswithrespecttotheir performance awell s asflex ibility. And, in addition, try to findoutwhether the proposedheuristic iin sfactoptimalenough owhethe r some r better solutioncanbperoposed.

3.4ExistingControl System The existing automationcontrolsystemfor thistechnologicalproce twomainparts. 1)Subsystemfor the controlof pushing slabsintofurnaces(PS) The maingoalof thissubsystem,which dependson the givenproduction s actualsituationinside the pushfurnaces, is to schedule slabs

ssiscomposed from

chedule and the fromdifferentsourcesinto the

working furnaces. 2)Subsystemfor the controlof the heating processinside furnaces( HP). The maingoalof thissubsystemis to compute the course othe f optimalslab heating intoaccountthe actualstate inside the push furnace and its future states following the schedule proposedinPSsubsystem.

taking ,

The heartof the PSsubsystemisitsinformationpartimplement ed iF n ORTRAN 77. In order toimprove the originalnaive approachwhichscheduled slabsincycl e, sapecialheuristic for thisprocesswasfound arasesultof daetailedstudy othe ft echnology. The main idea here is to groupthe slabs withsimilar temperature athe t input into sequences the length owhich f are approximately equaltothe lengthozones f inside furnaces. Each furnac heassixheating zones whichare tosome extentindependentandeasy tcoontrolwith respect to the actualtemperature and energy consumption. The taskhasbeencomplicatedbtyhe following circumstances. 1)There are four differentsourcesof slabsto bpeushedintothe push f outputtemperaturesof slabs,i.e. • directsequence shortafter slabsare castled aZPO t o1ZPO r • fromthe warmstoresof ZPO 1andZPO 2, • fromthe coldstore after finishing,or fromthe field store, and • fromslabbing. For the purposesof optimisationinour programwe currently disti warm (firsttwoonthe listabove) and cold(the lasttwo itnhislist). 2)Specialsituationsmay occur,suchas: • the number of working pushfurnaceschanges(e.g. maintenance repair of a • expectedsequence of slabsfrom w a arm source comeslater (or • other changesinthe currentproductionschedule.

urnaceswith various 2,

nguish two kind osources: f

NP); earlier) than planned;

The currentimplementationothe f scheduling algorithmsolvesthe spe cialsituations(it recognises10 othem f which are mostlikely tohappen) inthe formof specialised subprograms whichcanbsetartedarasesultof aninteractionwiththe res ponsible dispatcher.

4. SolutionUsingCLP Inthissectionour solutiontothe problemspecified in Section 3.3 using CLPapproach willbe precisely specifiedstarting withdata structure we used to representslabs, following btyhe inputdata wuese tocalculate the schedule oslabs f for the push furna cesfor parespecified productionschedule,andfinally the mainpartof the CLPprogramitsel ispresented f and explained.

4.1Data Structures Tostore informationaboutslabswe use for eachslab structure a

of the following type:

slab(Type, FurnaceNr, TimeIN, TimeOUT) where the argumentsare: • Type ithe s type othe f slab. Eachtype oslab f has uanique number which i size,quality andsource othe f slab(itis kanowninteger); • FurnaceNr specifiesthe number of the push furnace in which the slab willbe he (thisis fainite domainvariable withthe initialdomain ainte s Nr_of_furnaces>); • TimeIN representsorder inwhichthe slabwillbe pushed into the push furnace domainvariable, the initialisationoits fdomain iexplained s itnhe • TimeOUTrepresents the order inwhichthe slab willbe pushed outfromthe pus furnace (known integer,given btyhe production schedule).

mpliesthe ated rval Source i j then Costij = (TimeIN 4* i TimeIN j ) else Costij = (Max 2* TimeIN TimeIN j The totalcostisgiventhenasasumof allsuchneighbourhood pairs( andthe whole productionschedule). Eachproposedschedule ievaluated s withrespectto thiscostfunction minimalvalue iproposed s afinal s schedule.

i

j

). for allpush furnaces and the one with

4.Labelling Defining variablesandstating constraintsin CLP a program isusually notenough tgoet solution.Fromthe efficiency reasonsthe constraintpropagation t echniquesbuiltin CLP a systemmake trade-off a betweenefficiency and levelof a chieved consistency. As raesult, the solversare incomplete (see Subsection2.1) andthe search inthe reduced search space mustbe done instantiating stepbsytepdomainvariableswithvaluesfrom their domains(thisprocessis called labelling).Thisisinterleavedwith constraintpropagation automatically tr iggered after eachinstatiation. Inour programspeciallabelling predicate our_labelling/2 iused. s Ittakesstep bsytep a outputorder (slabathe t endosome f pushfurnace) andlooksfor some slab, which could be pushedathis t time into the same furnace. Simultaneously, occupat ion and costare checked (see 3and .4.stepinthe descriptionothe f constraintsabove).If necessary, two othree r slabs are pushedintothe same furnace one after another inorder to sa tisfy the check_occupation/2 constraint.If noslabcanbfeoundtsoatisfy allthe constrai nts, the programstopssearch and (if itexist) printsthe solution withminimalcost(other wise there ino ssolution for thisinput data). The programoffersthe possibility tovisualise the bestsolution and simulate the whole schedule stepbsytep.

5. Conclusion The proposedCLPmodelworkswellfor homogeneous(arbitrary number of) furnacesof arbitrary length.The programisable togenerate allpossible or deringsof slabson inputto getthe requestedoutputordering (productionschedule) and chose the schedule with mini malvalue of costfunctiondefinedathe t endoprevious f Subsection 4.3. Butthe actualprogramhas daecisive disadvantage thatitisnot efficientenough for realistic data (i.e.productionschedule with60slabs). There are tw main o reasonsof this behaviour. Firstly,the constraintsby thisrepresentation can notpropagate t he new information which isinstantiating domainvariables FurnaceNr and TimeINof some slab (i.e. choosing slab a tboe pushedintosome furnace) during the our_labelling/2procedure. As raesult, domainsare not significantly reduced,constraintpropagationinot s powerfulenough and ther efore dominates search. Secondly,due tothe factthatproduction schedule usually includesconsecut ive groupsof slabsof the same type,the number of solutionsisvery high. Many otf hemare generated btyhe program(exceptof solutionscutdownbtyhe optimisation constraint check_cost/2). Analysing these sourcesof inefficiency wdeecided to try another representation which wouldnotdistinguishslabsof the same type fromthe given production sche dule, or generate new constraintswhichwillhelpthe constraintpropagation respectively.

Acknowledgements We wouldlike tothankD. Malindžák and I. Koštialfromthe Faculty BERG the of Technical University oKošice f for valuable discussionsabout the t echnology and the automationcontrolsystemwhichthey proposedfor the technologicalproce ssdescribed ionur paper.We alsowouldlike tothank our student P. Sviežený who helped uby simplementing our CLPprogramtogether withgraphicaluser interface.

References Cras,J.Y.(1993),“A Review of IndustrialConstraintsolving Tools”, AI Oxford,UnitedKingdom. Dincbas,M.,Hentenryck,P.Van Simonis, , H.,Aggoun, A., Graf, T. and Berthie “The ConstraintLogic Programming Language CHIP”, Proc. of the I GenerationComputer Systems,ICOT. Jaffar,J.andLassez,J.L.(1987),“ConstraintLogic Programming”, POPL'87,Munich,Jan.1987,pp.111-119. Jaffar,J.,Michaylov,S.,Stuckey, and P.Yap,R.(1992),“The CLP(R) lang ACMTransactionsonProgramming Languages, Vol. 3, Nr. 14, pp. 339-395. Malindžák,D.(1993),“The projectof automationand co-ordination the production TSP,ZPO andNPdiv.OCE¼,VSŽ a.s.Košice”, TechnicalReport, Tec of Košice .

Perspective Series, r, F. (1988), nt. Conf. on fifth Proc. of the 14

th

Symp.

uage and System”, schedules hnicalUniversity

Suggest Documents