Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/VDM/VDMPP/trayallocationPP/   (Vienna Development Method ©)  Datei vom 13.4.2020 mit Größe 1 kB image not shown  

Quelle  AllocatorOneTray.vdmpp

  Sprache: VDM
 

-- ===============================================================================================================
-- AllocatorOneTray in tray allocation for a sortation system
-- By José Antonio Esparza and Kim Bjerge - spring 2010
-- (strategy pattern)
-- ===============================================================================================================

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;

        -- Returns true if higher priority inductions in induction group
  public InductionsWithHigherPriority: InductionController ==> bool
  InductionsWithHigherPriority(ic) ==
   return exists i in set elems trayAllocator.inductionGroup(1,...,len  trayAllocator.inductionGroup) 
       & i.GetId() <> ic.GetId() 
       and i.GetPriority() > ic.GetPriority()
    --  Looking at induction infront this ic causes starvation of the first induction in group
   --  return exists i in set elems inductionGroup(ic.GetId()+1,...,len inductionGroup) & i.GetPriority() > ic.GetPriority()
  pre ic in set elems trayAllocator.inductionGroup;


end AllocatorOneTray

Messung V0.5 in Prozent
C=75 H=100 G=88

¤ Dauer der Verarbeitung: 0.18 Sekunden  (vorverarbeitet am  2026-06-07) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.