cz.cuni.amis.pogamut.ut2004.tournament.deathmatch
Class UT2004DeathMatchRepeater

Package class diagram package UT2004DeathMatchRepeater
java.lang.Object
  extended by cz.cuni.amis.pogamut.ut2004.tournament.deathmatch.UT2004DeathMatchRepeater
All Implemented Interfaces:
Runnable, Callable<List<UT2004DeathMatchResult>>

public class UT2004DeathMatchRepeater
extends Object
implements Callable<List<UT2004DeathMatchResult>>, Runnable

Simple class that allows to run 1 match multiple times automatically suffixing ID of the match (name of the output directory) with numbers.

THREAD-UNSAFE!

Author:
Jimmy

Field Summary
protected  List<Throwable> exceptions
           
protected  UT2004DeathMatchConfig matchConfig
           
protected  int repeats
           
protected  List<UT2004DeathMatchResult> results
           
 
Constructor Summary
UT2004DeathMatchRepeater()
          Parameter-less constructor, don't forget to initialize UT2004DeathMatchRepeater#setMatchConfig(UT2004Match) and setRepeats(int).
UT2004DeathMatchRepeater(cz.cuni.amis.pogamut.base.utils.logging.LogCategory log)
          Parameter-less constructor, don't forget to initialize UT2004DeathMatchRepeater#setMatchConfig(UT2004Match) and setRepeats(int).
UT2004DeathMatchRepeater(UT2004DeathMatchConfig match, int repeats, cz.cuni.amis.pogamut.base.utils.logging.LogCategory log)
           
 
Method Summary
 List<UT2004DeathMatchResult> call()
           
 List<Throwable> getExceptions()
          After the run() or call() returns list of exceptions that had happened during matches (Array is guaranteed to have the length of repeats, some items may be null.
 cz.cuni.amis.pogamut.base.utils.logging.LogCategory getLog()
          Log that is being used.
 UT2004DeathMatchConfig getMatchConfig()
          Which match we're going to evaluate.
protected  String getNum(int i, int max)
           
 int getRepeats()
          How many times we will repeat the getMatchConfig().
 List<UT2004DeathMatchResult> getResults()
          After the run() or call() returns list of match results (Array is guaranteed to have the length of repeats, some items may be null == exception happened).
protected  cz.cuni.amis.utils.token.Token getToken(cz.cuni.amis.utils.token.IToken orig, int i, int max)
           
protected  void outputAggregatedResults()
           
protected  void outputAggregatedResults(File outputDirectory)
           
 void run()
           
 void setLog(cz.cuni.amis.pogamut.base.utils.logging.LogCategory log)
           
 void setMatchConfig(UT2004DeathMatchConfig matchConfig)
           
 void setRepeats(int repeats)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

matchConfig

protected UT2004DeathMatchConfig matchConfig

repeats

protected int repeats

results

protected List<UT2004DeathMatchResult> results

exceptions

protected List<Throwable> exceptions
Constructor Detail

UT2004DeathMatchRepeater

public UT2004DeathMatchRepeater()
Parameter-less constructor, don't forget to initialize UT2004DeathMatchRepeater#setMatchConfig(UT2004Match) and setRepeats(int).


UT2004DeathMatchRepeater

public UT2004DeathMatchRepeater(cz.cuni.amis.pogamut.base.utils.logging.LogCategory log)
Parameter-less constructor, don't forget to initialize UT2004DeathMatchRepeater#setMatchConfig(UT2004Match) and setRepeats(int).


UT2004DeathMatchRepeater

public UT2004DeathMatchRepeater(UT2004DeathMatchConfig match,
                                int repeats,
                                cz.cuni.amis.pogamut.base.utils.logging.LogCategory log)
Method Detail

getNum

protected String getNum(int i,
                        int max)

getToken

protected cz.cuni.amis.utils.token.Token getToken(cz.cuni.amis.utils.token.IToken orig,
                                                  int i,
                                                  int max)

getLog

public cz.cuni.amis.pogamut.base.utils.logging.LogCategory getLog()
Log that is being used.

Returns:

setLog

public void setLog(cz.cuni.amis.pogamut.base.utils.logging.LogCategory log)

getMatchConfig

public UT2004DeathMatchConfig getMatchConfig()
Which match we're going to evaluate.

Returns:

setMatchConfig

public void setMatchConfig(UT2004DeathMatchConfig matchConfig)

getRepeats

public int getRepeats()
How many times we will repeat the getMatchConfig().

Returns:

setRepeats

public void setRepeats(int repeats)

getExceptions

public List<Throwable> getExceptions()
After the run() or call() returns list of exceptions that had happened during matches (Array is guaranteed to have the length of repeats, some items may be null. Usually all.)

Immutable.

Returns:

getResults

public List<UT2004DeathMatchResult> getResults()
After the run() or call() returns list of match results (Array is guaranteed to have the length of repeats, some items may be null == exception happened).

Immutable.

Returns:

call

public List<UT2004DeathMatchResult> call()
                                  throws Exception
Specified by:
call in interface Callable<List<UT2004DeathMatchResult>>
Throws:
Exception

run

public void run()
Specified by:
run in interface Runnable

outputAggregatedResults

protected void outputAggregatedResults()

outputAggregatedResults

protected void outputAggregatedResults(File outputDirectory)


Copyright © 2013 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.