Class Analyser

java.lang.Object
  extended by Analyser

public class Analyser
extends java.lang.Object

The snEADy Analyser is a very small tool to evaluate several round data from snEADy.

If the file "logs/result.log" has changed in the home directory from snEADy all player names and points were read from this file. After that the average ranks were calculated and copied to the clipboard.

This tool may be useful to assess and improve your own snake. All you have to do is to start the batch file (check that the location of the result.log is right) and than start the snEADy game several times. You might do this also with a batch file.

Any questions? There's no need to be shy - mail to tthuem[at]web.de.

Version:
1.0
Author:
Thomas Thüm

Field Summary
private static double[] averageRank
          Average rank of all happend players.
private static long lastModified
          Last time the log file was modified.
private static java.io.File logFile
          The specified log file.
private static int MAX_PLAYER
          Maximum count of players in the tournament.
private static int playerCount
          Count of players already happened in this tournament.
private static java.lang.String[] playerName
          Names of all happend players.
private static int[] playTimes
          Count of the times a player was registerd in this tournament.
private static int[] points
          Cumulated points of the players.
private static int roundCount
          Count of rounds in this tournament.
private static int UPDATE_CYCLE
          Count of milliseconds the modified time of the log file was checked.
 
Constructor Summary
Analyser()
           
 
Method Summary
private static void checkFileChanges()
          Checks if the log file has changed and reads the new round data.
static void main(java.lang.String[] args)
          Starts the application with the location of the "logs/result.log" as a parameter
private static void printTournamentData()
          Prints the current tournament data and copies it to the clipboard.
private static void readNextRound()
          Reads the round data from the specified log file.
static void setClipboardContents(java.lang.String content)
          Places a string on the clipboard.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UPDATE_CYCLE

private static final int UPDATE_CYCLE
Count of milliseconds the modified time of the log file was checked.

See Also:
Constant Field Values

logFile

private static java.io.File logFile
The specified log file.


lastModified

private static long lastModified
Last time the log file was modified.


MAX_PLAYER

private static final int MAX_PLAYER
Maximum count of players in the tournament.

See Also:
Constant Field Values

playerCount

private static int playerCount
Count of players already happened in this tournament.


roundCount

private static int roundCount
Count of rounds in this tournament.


playerName

private static java.lang.String[] playerName
Names of all happend players.


averageRank

private static double[] averageRank
Average rank of all happend players.


points

private static int[] points
Cumulated points of the players.


playTimes

private static int[] playTimes
Count of the times a player was registerd in this tournament.

Constructor Detail

Analyser

public Analyser()
Method Detail

main

public static void main(java.lang.String[] args)
Starts the application with the location of the "logs/result.log" as a parameter

Parameters:
args - should contain only one parameter

checkFileChanges

private static void checkFileChanges()
Checks if the log file has changed and reads the new round data.


readNextRound

private static void readNextRound()
Reads the round data from the specified log file.


printTournamentData

private static void printTournamentData()
Prints the current tournament data and copies it to the clipboard.


setClipboardContents

public static void setClipboardContents(java.lang.String content)
Places a string on the clipboard.