Module Simula

Class RTS_Ranking

java.lang.Object
simula.runtime.RTS_Ranking
Direct Known Subclasses:
RTS_EVENT_NOTICE

public class RTS_Ranking extends Object
Utility class Ranking.

This is an implementation of a balanced tree used to support the sequencing set in class Simulation.

Link to GitHub: Source File.

Author:
Øystein Myhre Andersen
  • Field Details

  • Constructor Details

    • RTS_Ranking

      RTS_Ranking()
      Default Constructor.
  • Method Details

    • PRED

      static RTS_Ranking PRED(RTS_Ranking ins)
      Returns the predecessor of the given instance.
      Parameters:
      ins - the given instance
      Returns:
      pred the predecessor of the given instance.
    • SUC

      static RTS_Ranking SUC(RTS_Ranking ins)
      Returns the successor of the given instance.
      Parameters:
      ins - the given instance
      Returns:
      suc the successor of the given instance.
    • CLEAR

      static void CLEAR(RTS_Ranking head)
      Clear the Ranking tree.
      Parameters:
      head - the head of the tree
    • EMPTY

      static boolean EMPTY(RTS_Ranking head)
      Check if the Ranking tree is empty.
      Parameters:
      head - the head of the tree
      Returns:
      true if the Ranking tree is empty, otherwise false
    • FIRST

      static RTS_Ranking FIRST(RTS_Ranking head)
      Returns the first element of the ranking tree.
      Parameters:
      head - the head of the tree
      Returns:
      the first element of the ranking tree
    • LAST

      static RTS_Ranking LAST(RTS_Ranking head)
      Returns the last element of the ranking tree.
      Parameters:
      head - the head of the tree
      Returns:
      the last element of the ranking tree
    • FOLLOW

      static void FOLLOW(RTS_Ranking ins, RTS_Ranking prd)
      Insert 'ins' following 'prd'.
      Parameters:
      ins - argument
      prd - argument
    • OUT

      static void OUT(RTS_Ranking ins)
      Remove 'ins' from the ranking tree.
      Parameters:
      ins - argument
    • INTO

      static void INTO(RTS_Ranking ins, RTS_Ranking head, double rnk)
      Insert 'ins' intp the ranking tree acording to the ranking value.
      Parameters:
      ins - argument
      head - the head of the tree
      rnk - the ranking value
    • PRECEDE

      static void PRECEDE(RTS_Ranking ins, RTS_Ranking suc)
      Insert 'ins' preceding 'suc'.
      Parameters:
      ins - argument
      suc - argument
    • INTO_PRIOR

      static void INTO_PRIOR(RTS_Ranking ins, RTS_Ranking head, double rnk)
      Insert 'ins' into the ranking tree acording to the ranking value with priority.
      Parameters:
      ins - argument
      head - the head of the tree
      rnk - the ranking value