Rainbow Sort - Simulator
Starting the simulator
Option 1: jar file
- Download the jar file.
- Execute "java -jar RainbowSort.jar" in the directory where RainbowSort.jar
has been saved in order to run the program.
Alternatively, Windows users may start the program by a double-click.
Option 2: source files
- Download the zip archive that contains all source files.
- Extract the zip file.
- Change to the extracted directory "RainbowSort".
- Execute "javac *.java" in order to compile the program.
- Execute "java RainbowSort" in order run the program.
Using the simulator
The GUI consists of three parts:
The control interface.
- The Start/Stop/Continue/Reset-Button can be used to start the simulation.
When the simulation runs, the button can be used to stop the simulation.
When the simulation has been stopped, the button can be used to continue
When the simulation has terminated, the button can be used to reset the
When the simulation has been reset, the button can be used to restart the
- When the simulation does not run, the "New Instance"-Button can be used
to generate a new instance. A dialog is opened and the user can specify
the number of keys that should be sorted and the maximum value of the keys.
The new instance is generated randomly according to these parameters.
The slider can be used to alter the speed of the simulation. The slider
sets the delay of each simulated time step in milliseconds, i.e., a smaller
value means faster.
The input/output table.
- The first row contains the unsorted input data.
- The second row contains the wavelengths that represent the input data.
- The third row is filled by the sorted output data during the simulation.
The setup of Rainbow Sort where the simulation is visualized.