170 likes | 291 Views
Tray allocation for a sortation system Iteration III. TI-VDM1 Project by José Antonio Esparza and Kim Bjerge. Contents of presentation. The induction group and the environment Considered architectures I: the centralized architecture
E N D
Tray allocation for a sortation systemIteration III TI-VDM1 Project by José Antonio Esparza and Kim Bjerge Sortation System, TrayAllocation
Contents of presentation • The induction group and the environment • Considered architectures I: the centralized architecture • Considered architectures II: the distributed architecture • Allocation strategies I: Pattern matching allocation algorithm • Allocation strategies II: The priority scheme algorithm • Class diagrams with operations and variables • Snippet of VDM++ code for TrayAllocator and demonstration of simulation model Sortation System, TrayAllocation
Induction group – Tray allocation Induction group A simplified sorter model Inductions Tray Id. Reader Sorter ring Sortation System, Tray Allocation
The centralized architecture Sortation System, Tray Allocation
The distributed architecture Sortation System, Tray Allocation
The pattern matching allocation algorithm • The sorter state is represented using an state-array (empty/occupied) • The induction request are codified, generating an induction pattern per time step. • The key point is to match the one’s complemented induction pattern with the state-array. The sorter state: 1010010100 Target pattern: 0X0XX The induction pattern: 1X1XX Sortation System, Tray Allocation
The priority scheme allocation algorithm • A value called priority is incremented by value n every time an induction controller has wait one tray step to induct an item. • General rule: • Each induction is allowed to induct an item to the sorter unless there is other induction with a higher priority requesting a tray. • Faster and self-organized system. Sortation System, Tray Allocation
Algorithm comparison • Pattern matching allocation algorithm • Connected with the centralized architecture. • Higher software maintainability • An optimized item allocation can be reached • Stronger computational requirements • Priority scheme allocation algorithm • Connected with the distributed architecture • Reliability • Flexibility • Easier to extend by adding more inductions • Simplier strategy and less computing demanding effort. Sortation System, Tray Allocation
Class diagram centralized architecture Sortation System, Tray Allocation
Class diagram with operations and variables Sortation System, Tray Allocation
Use of strategy pattern for allocation of trays Sortation System, Tray Allocation
Sequence diagram for allocation simulation Sortation System, Tray Allocation
TrayAllocator – instance variables instance variables -- Ensure sufficient number of trays on sorter ring based on inductions and separation inv NumOfTrays >= InductionSeperation * NumOfInductions; countTraySteps : nat := 0; -- Used for calculation of throughput countItemsInducted : nat := 0; -- Counts the number of items inducted -- Induction group and invariants public inductionGroup : seq of InductionController := []; inv len inductionGroup = NumOfInductions; inv forall x,y in set elems inductionGroup & x <> y => x.GetId() <> y.GetId(); -- Sorter ring and invariants public sorterRing : inmap Tray`UID to Tray; inv card dom sorterRing = NumOfTrays; -- Tray at card reader and invariants public trayAtCardReader : Tray`UID := 0; inv trayAtCardReader > 0 => trayAtCardReader in set dom sorterRing; Sortation System, Tray Allocation
TrayAllocator – InductItem operation -- Inducting item on sorter if empty trays and no higher induction priority public InductItem: InductionController * Item ==> bool InductItem(ic, item) == ( if InductionsWithHigherPriority(ic) then return false else let numTrays = item.GetSizeOfTrays(), trays = AllocateTray(ic.GetId(), numTrays) in if trays = {} then return false else ( countItemsInducted := countItemsInducted + 1; IO`print("Induction id " ^ String`NatToStr(ic.GetId()) ^ "\n"); PutItemOnTrays(item, trays); return true; ) ) pre ic in set elems inductionGroup; Sortation System, TrayAllocation
TrayAllocator – AllocateTray operation -- Returns true if no higher priority of inductions in front of this induction private InductionsWithHigherPriority: InductionController ==> bool InductionsWithHigherPriority(ic) == return exists i in set elems inductionGroup(ic.GetId()+1,...,len inductionGroup) & i.GetPriority() > ic.GetPriority() pre ic in set elems inductionGroup; -- Returns set of empty trays at trayAtCardReader private AllocateTray: nat * Item`ItemTraySize ==> set of Tray AllocateTray(icid, size) == ( -- Use of strategy pattern to compute the tray allocation dcl strategy : AllocatorStrategy; if size = 1 then strategy := new AllocatorOneTray(self) else strategy := new AllocatorTwoTray(self); return strategy.AllocateTray(icid); ) pre icid in set inds inductionGroup and size <= 2; -- To be changed if ItemMaxTrays is increased Sortation System, Tray Allocation
AllocatorOnTray strategy class AllocatorOneTray is subclass of AllocatorStrategy operations -- AllocatorOneTray constructor public AllocatorOneTray: TrayAllocator==> AllocatorOneTray AllocatorOneTray(ta) == ( trayAllocator := ta; ); -- Allocates tray if empty at induction offset public AllocateTray: nat ==> set of Tray AllocateTray (icid) == def posTray = InductionOffset(trayAllocator.trayAtCardReader, icid) in if trayAllocator.sorterRing(posTray).IsTrayEmpty() then return {trayAllocator.sorterRing(posTray)} else return {} pre icid in set inds trayAllocator.inductionGroup; end AllocatorOneTray Sortation System, Tray Allocation
Next objectives • The main objectives for next week are: • Testing and completing the model • More test scenarios • Writing on the report • Description of algorithm and architecture is started Sortation System, Tray Allocation