TRON Instructions

General Requirements

  1. Microsoft Windows NT/XP/2003
  2. Sun Java 5 SDK

Demo of TRON with smart lamp controller

  1. Start command line window (Start->Run, cmd.exe)
  2. go to smart-lamp (this) directory
  3. start another instance of cmd.exe (type "start cmd.exe")

Run Demo in Simulated time case:

  1. in one command line window start smart-lamp by typing:
    java -cp . LightController/LightController -C localhost 8989 -M 0
  2. in another command line window start TRON by typing:
    tron.exe -Q 8989 -P random -F 300 -I SocketAdapter -v 9 LightContr.xml -- localhost 9999

Run Demo in Real time

  1. in one command line window start smart-lamp by typing:
    java LightController/LightController -M 0
  2. in another command line window start TRON by typing:
    tron.exe -P random -F 300 -I SocketAdapter -v 9 LightContr.xml -- localhost 9999

Mutant Exercise

To do the Light Controller Mutant exercise you need the model LightContr4.xml, and the following command lines to start TRON and the controller

  1. >tron.exe -Q 8989 -P 10,200 -F 300 -I SocketAdapter -v 10 -w 20 LightContr4.xml -- localhost 9999
  2. >java -cp . LightController.LightController -C localhost 8989 -M 0

You can run the mutants via the -M option, eg use -M 1 for mutant 1, and -M 2 for mutant 2

The easiest way to create you own mutants is to modify the existing LightController source and add mutants in the style of the existing mutants (a flag indicates what mutant to run, and use if(mutantID) statements to enable the faulty code. You typically need to edit the LightController.java file and Dimmer.java file. Remember to recompile the LightController:

javac -cp . LightController/*.java

(the compiler is typically installed in a directory name similarly to this: C:\Program Files\Java\jdk1.5.0_07\bin;)

Create your own light Controller

Here you have to create both a model and an implementation. It is easiest to start with the template given in onOffLight.xml and LightController/OnOffLightController.java

  1. java -cp . LightController.OnOffLightController -C localhost 8989 -M 0
  2. tron.exe -Q 8989 -P 10,200 -F 300 -I SocketAdapter -v 10 onOffLight.xml -- localhost 9999