- Start command line window (Start->Run, cmd.exe)
- go to smart-lamp (this) directory
- start another instance of cmd.exe (type "start cmd.exe")
Run Demo in Simulated time case:
- in one command line window start smart-lamp by typing:
java -cp . LightController/LightController -C localhost 8989 -M 0- in another command line window start TRON by typing:
tron.exe -Q 8989 -P random -F 300 -I SocketAdapter -v 9 LightContr.xml -- localhost 9999Run Demo in Real time
- in one command line window start smart-lamp by typing:
java LightController/LightController -M 0- in another command line window start TRON by typing:
tron.exe -P random -F 300 -I SocketAdapter -v 9 LightContr.xml -- localhost 9999
To do the Light Controller Mutant exercise you need the model LightContr4.xml, and the following command lines to start TRON and the controller
- >tron.exe -Q 8989 -P 10,200 -F 300 -I SocketAdapter -v 10 -w 20 LightContr4.xml -- localhost 9999
- >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;)
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
- java -cp . LightController.OnOffLightController -C localhost 8989 -M 0
- tron.exe -Q 8989 -P 10,200 -F 300 -I SocketAdapter -v 10 onOffLight.xml -- localhost 9999