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

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

public class UT2004DeathMatch
extends UT2004Match<UT2004DeathMatchConfig,UT2004DeathMatchResult>


Nested Class Summary
 
Nested classes/interfaces inherited from class cz.cuni.amis.pogamut.ut2004.tournament.match.UT2004Match
UT2004Match.Bots
 
Field Summary
 
Fields inherited from class cz.cuni.amis.pogamut.ut2004.tournament.match.UT2004Match
config, exception, fileHandler, log, result, teamMatch
 
Constructor Summary
UT2004DeathMatch(UT2004DeathMatchConfig config, cz.cuni.amis.pogamut.base.utils.logging.LogCategory log)
           
 
Method Summary
protected  void changeBotTeam(UT2004Server server, cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId botId, int desiredTeam)
           
 UT2004DeathMatchResult execute()
          Performs the match and return the result (or throw an exception in case of error).
protected  void outputResults_step1(UT2004DeathMatchResult result, File outputDirectory)
           
protected  void outputResults_step2(UT2004DeathMatchResult result, File outputDirectory)
           
protected  void outputResults(UCCWrapper ucc, UT2004Server server, UT2004Analyzer analyzer, UT2004Match.Bots bots, UT2004MatchResult result, File outputDirectory)
          Usually STEP 12 ...
protected  UT2004DeathMatchResult processResults(UCCWrapper ucc, UT2004Server server, UT2004Analyzer analyzer, UT2004Match.Bots bots, List<cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId> winners, Map<cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId,PlayerScore> finalScores)
           
protected  UT2004MatchResult waitMatchFinish(UCCWrapper ucc, UT2004Server server, UT2004Analyzer analyzer, UT2004Match.Bots bots, long timeoutInMillis)
          Usually STEP 10 ...
 
Methods inherited from class cz.cuni.amis.pogamut.ut2004.tournament.match.UT2004Match
call, cleanUp, closeLogger, copyReplay, createGB2004Ini, getConfig, getCurrentDate, getException, getGB2004IniFile, getLog, getMatchId, getOutputPath, getOutputPath, getResult, getUccHome, isTeamMatch, matchIsAboutToBegin, recordReplay, restartMatch, restoreGB2004IniBackup, run, setupLogger, shutdownAll, startAnalyzer, startBots, startControlServer, startUCC, toString, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UT2004DeathMatch

public UT2004DeathMatch(UT2004DeathMatchConfig config,
                        cz.cuni.amis.pogamut.base.utils.logging.LogCategory log)
Method Detail

changeBotTeam

protected void changeBotTeam(UT2004Server server,
                             cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId botId,
                             int desiredTeam)
Overrides:
changeBotTeam in class UT2004Match<UT2004DeathMatchConfig,UT2004DeathMatchResult>

waitMatchFinish

protected UT2004MatchResult waitMatchFinish(UCCWrapper ucc,
                                            UT2004Server server,
                                            UT2004Analyzer analyzer,
                                            UT2004Match.Bots bots,
                                            long timeoutInMillis)
Description copied from class: UT2004Match
Usually STEP 10 ... you wait for a predefined time (blocking method) for the match to finish.

This method may need to be override to provide correct MATCH-FINISHED detecting routine.

Always abide the timeout!

Don't forget to observe whether all 'custom bots' are running! Use UT2004BotExecution.getRunning() flag and FlagListener.

Raises exception in case of any error / timeout

Specified by:
waitMatchFinish in class UT2004Match<UT2004DeathMatchConfig,UT2004DeathMatchResult>
Parameters:
ucc - MUST NOT BE NULL
server - MUST NOT BE NULL
analyzer - may be null
bots - MUST NOT BE NULL
timeoutInMillis - must be specified correctly
Returns:
who has won (or null in case of failure / timeout)

processResults

protected UT2004DeathMatchResult processResults(UCCWrapper ucc,
                                                UT2004Server server,
                                                UT2004Analyzer analyzer,
                                                UT2004Match.Bots bots,
                                                List<cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId> winners,
                                                Map<cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId,PlayerScore> finalScores)

outputResults_step1

protected void outputResults_step1(UT2004DeathMatchResult result,
                                   File outputDirectory)

outputResults_step2

protected void outputResults_step2(UT2004DeathMatchResult result,
                                   File outputDirectory)

outputResults

protected void outputResults(UCCWrapper ucc,
                             UT2004Server server,
                             UT2004Analyzer analyzer,
                             UT2004Match.Bots bots,
                             UT2004MatchResult result,
                             File outputDirectory)
Description copied from class: UT2004Match
Usually STEP 12 ... concludes the match by producing/presenting whatever statistics needed about the match. Everything should be outputted to 'outputDirectory'.

Raises exception in case of any error / timeout

Specified by:
outputResults in class UT2004Match<UT2004DeathMatchConfig,UT2004DeathMatchResult>
Parameters:
ucc - MUST NOT BE NULL
server - MUST NOT BE NULL
analyzer - may be null
bots - MUST NOT BE NULL
result - MUST NOT BE NULL
outputDirectory - MUST NOT BE NULL

execute

public UT2004DeathMatchResult execute()
Description copied from class: UT2004Match
Performs the match and return the result (or throw an exception in case of error).

It is called by UT2004Match.run() that is used by UT2004Match.call().

Specified by:
execute in class UT2004Match<UT2004DeathMatchConfig,UT2004DeathMatchResult>
Returns:


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