Class RTA

public class RTA
extends Frame
implements ActionListener
This is the main class for the Reservation Table Analyzer. Creating an instance of this class will start up a new Reservation Table Analyzer applicaton.
 

Variables

o tableA
    public Table tableA

        Reservation Table A

o tableB
    public Table tableB

        Reservation Table B

o twoTasks
    public boolean twoTasks

        Is true when the program is analyzing two tasks
        else false

o titlePanel
    private Panel titlePanel

        The starting title screen

o tip
    private TableInputPanel tip

        The Reservation Table Input panel. It allows the user to enter the reservation table information such as number of resources and time slots.

o mainPanel
    private Panel mainPanel

        The center panel in the application. This panel uses CardLayout to switch between different panels. For example, when the user presses the Reservation Table Input button the TableInputPanel is displayed in the mainPanel position.

o mainLayout
    private CardLayout mainLayout

        The layout manager for the mainPanel.

o mainLayout
    public Panel northPanel

        A panel that is located at the top of the application. It displays the current task pattern and allows the user to enter a new task pattern when the application is in two task mode.

o patternLabel
    private Label patternLabel

        Displays the words: "Enter task pattern."

o currPatternLabel
    private Label currPatternLabel

        Displays the current task pattern.

o patternTextField
    private TextField patternTextField

        A TextField object that allows the user to change the current task pattern.

o patternButton
    private Button patternButton

        When this button is pressed it processes the string in the patternTextField and updates the current task pattern.

o pattern
    private String pattern

        The current task pattern.

o southPanel
    private Panel southPanel

        A panel located at the bottom of the application that holds a group of buttons.

o iButton
    private Button iButton

        Pressing this button will bring up the Reservation Table Input panel where the user can create or modify a reservation table.

o sdButton
    private Button sdButton

        Pressing this button will calculate the state diagram for the current reservation table and displays it.

o qButton
    private Button qButton

        Pressing this button will quit the application.

o hButton
    private Button hButton

        Pressing this button will bring up the Help panel.

o stButton
    private stButton

        Pressing this button will calculate certain statistics about the current pipeline and display them. The statistics include PCV, MAL, Forbidden Latencies, Greedy Cycle, etc.

o states
    private Vector states

        A vector of State objects. Keeps track of all the states for the current reservation table input.

o greedyPath
    private Vector greedyPath

        A vector of Edge objects. These objects form the greedy cycle.

o statsPanel
    private TextPanel statsPanel

        This is where the pipeline statistics are displayed.

o helpPanel
    private TextPanel helpPanel

        A panel that displays instructions on how to use this application

o ps
    private boolean ps

        A variable that is used to keep track of what is currently being displayed in the mainPanel.
        If the Pipeline Statistics panel is being displayed then ps is true else ps is false.
 

Constructors

o RTA
    public RTA()

        Initialization. The application is created and the components such as panels and buttons are laid out.
 

Methods

ocreateHelpPanel
    public void createHelpPanell()

        Setup the Help Panel.

osetPatternEnabled
    public void setPatternEnabled(boolean value)

        If value=true then the panel located at the top of the application is enabled
        else the panel is disabled.

ocreateNorthPanel
    public void createNorthPanel()

        Layout out all the components that appear at the top of the application.

ocreateTitlePanel
    public void createTitlePanel()

        Setup the title panel. The panel that appears in the center of the application with the words "Reservation Table Analyzer" shown at the center of the panel.

ocreateMainPanel
    public void createMainPanel()

        Setup the panel that is located at the center of the application. Add all the necessary components to the panel.

ocreateSouthPanel
    public void createSouthPanel()

        Layout out all the componetns that is suppose to appear at the bottom of the application.

oactionPerformed
    public void actionPerformed(ActionEvent e)

        This method is used to handle some of the user events in the program. Whenever the user presses one of the buttons located at the bottom this method is called and performs the appropriate task.

oupdatePattern
    public void updatePattern(String input)

        When the application is in two task mode, the user can change the current task pattern by entering a new pattern in the TextField object located at the top of the application. The method processes the string entered by the user and makes sure that it is a valid pattern before updating current task pattern.

ofindStates
    public boolean findStates()

        Finds all possible states for a given reservation table input.

oprintStates
    public void printStates()

        Prints out each state information onto the Java Console.

ofindGreedyCycle
    public boolean findGreedyCycle()

        Finds the greedy cycle for a given reservation table input.

oprintGreedyCycle
    public void printGreedyCycle()

        Prints out the greedy cycle for a given reservation table input.

oprintPCV
    public void printPCV()

        Prints out the PCV for reservation table A and table B onto a TextPanel object if the tables exists.

oprintForbiddenLatency
    public boolean findGreedyCycle()

        Prints out the forbiddeb latency for reservation table A and table B onto a TextPanel object if the tables exists.

oprintMALT
    public void printMALT

        Prints out the MAL and throughput onto a TextPanel object for a given reservation table input.

oprintStats
    public void printStats()

        Prints out pipeline statistics for a given reservation table input.



Send all bug reports and comments to tchou@elux3.cs.umass.edu