Class WarehouseApplication

java.lang.Object
  |
  +--DisplayPanel
        |
        +--WarehouseApplication
All Implemented Interfaces:
Runnable

public class WarehouseApplication
extends DisplayPanel
implements Runnable

Application simulating warehouse operation.

See Also:
Serialized Form

Field Summary
protected  double bias
          Bias towards removing a lot in this simulation.
protected static int delay
          Delay time for all simulations.
protected static Random generator
          Random number generator for all simulations.
protected  int lots
          Number of lots to be placed in this simulation.
protected  int maxSize
          Maximum size of a lot in this simulation.
protected  boolean stopNow
          Whether or not this simulation is stopped.
 
Constructor Summary
WarehouseApplication()
          Constructs the GUI for the application.
 
Method Summary
protected  void addStrategies()
          Adds the device drivers for use in this simulation.
 void addStrategy(ACraneStrategy s)
          Adds a strategy for use in this simulation.
protected  void createActionsPanel()
          Creates the actions panel for simulation actions.
protected  void delay()
          Delays this simulation.
protected  ACraneStrategy getStrategy(int index)
          Gets the strategy at the given index.
protected  void initializeSlider()
          Sets slider parameters.
protected  void installControlPanel()
          Installs the control panel for the simulation.
protected  void installCraneView()
          Installs the view for the warehouse crane.
protected  void installWarehouseView()
          Installs the view for the warehouse.
static void main(String[] args)
          Creates a new application GUI in its own window.
static double nextDouble()
          Returns the next random double value produced by the random number generator.
 void run()
          Runs this simulation.
protected  void start()
          Starts a new simulation.
protected  void stop()
          Stops the current simulation.
protected  void updateDelay()
          Updates the delay value for animation slowdown by storing the value of the slider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

delay

protected static int delay
Delay time for all simulations.


generator

protected static Random generator
Random number generator for all simulations.


stopNow

protected boolean stopNow
Whether or not this simulation is stopped.


lots

protected int lots
Number of lots to be placed in this simulation.


maxSize

protected int maxSize
Maximum size of a lot in this simulation.


bias

protected double bias
Bias towards removing a lot in this simulation.

Constructor Detail

WarehouseApplication

public WarehouseApplication()
Constructs the GUI for the application.

Method Detail

run

public void run()
Runs this simulation.

Specified by:
run in interface Runnable

addStrategy

public void addStrategy(ACraneStrategy s)
Adds a strategy for use in this simulation.


delay

protected void delay()
Delays this simulation.


start

protected void start()
Starts a new simulation.


stop

protected void stop()
Stops the current simulation.


updateDelay

protected void updateDelay()
Updates the delay value for animation slowdown by storing the value of the slider.


getStrategy

protected ACraneStrategy getStrategy(int index)
Gets the strategy at the given index.

Parameters:
index - the index of the desired strategy

createActionsPanel

protected void createActionsPanel()
Creates the actions panel for simulation actions.


initializeSlider

protected void initializeSlider()
Sets slider parameters.


installCraneView

protected void installCraneView()
Installs the view for the warehouse crane.


installWarehouseView

protected void installWarehouseView()
Installs the view for the warehouse.


installControlPanel

protected void installControlPanel()
Installs the control panel for the simulation.


addStrategies

protected void addStrategies()
Adds the device drivers for use in this simulation.


nextDouble

public static double nextDouble()
Returns the next random double value produced by the random number generator.


main

public static void main(String[] args)
Creates a new application GUI in its own window.

Parameters:
args - command-line arguments (ignored)