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

Package class diagram package UT2004DeathMatchTournamentConfig
java.lang.Object
  extended by cz.cuni.amis.pogamut.ut2004.tournament.deathmatch.UT2004DeathMatchTournamentConfig

public class UT2004DeathMatchTournamentConfig
extends Object

Configuration for the UT2004DeathMatchTournament class.

The most interesting method is cleanUp() that is using recursion to generate all possible matches for enlisted bots.

Do not forget to use setNumBotsInOneMatch(int)!

THREAD-UNSAFE!

Author:
Jimmy

Field Summary
protected  Map<cz.cuni.amis.utils.token.IToken,UT2004BotConfig> bots
          Custom (Pogamut) bots in the tournament.
protected  int fragLimit
          Used as UT2004DeathMatchConfig.setFragLimit(int).
protected  Map<cz.cuni.amis.utils.token.IToken,UT2004NativeBotConfig> nativeBots
          Native bots in the tournament.
protected  int numBotsInOneMatch
          How many bots should be present in one match.
protected  String outputDir
          Used as UT2004DeathMatchConfig.setOutputDirectory(File).
protected  int timeLimitInMinutes
          Used as UT2004DeathMatchConfig.setTimeLimit(int).
protected  cz.cuni.amis.utils.token.IToken tournamentId
          Unique id of the tournament.
protected  UCCWrapperConf uccConf
           
 
Constructor Summary
UT2004DeathMatchTournamentConfig()
          Parameter-less constructor, don't forget to initialize everything!
 
Method Summary
 UT2004DeathMatchTournamentConfig addBot(UT2004BotConfig... bots)
          Adds NEW bot configuration into the object, checks whether there is no BotId clash (if so, throws an exception).
 UT2004DeathMatchTournamentConfig addNativeBot(UT2004NativeBotConfig... bots)
          Adds NEW native bot configuration into the object, checks whether there is no BotId clash (if so, throws an exception).
 void cleanUp()
          WARNING: Removes directory with tournament results.
 UT2004DeathMatchTournamentConfig clearBots()
           
 UT2004DeathMatchTournamentConfig clearNativeBots()
           
 UT2004DeathMatchConfig createConfiguration(List<cz.cuni.amis.utils.token.IToken> chosenBots)
          Creates UT2004DeathMatchConfig for bots of ids from 'chosenBots'.
 UT2004DeathMatchConfig[] createMatcheConfigs()
          This method will create all combinations of matche configs that consists of 'numBotsInOneMatch' that is obtained via getNumBotsInOneMatch().
 UT2004DeathMatchConfig[] createMatcheConfigs(int numBotsInOneMatch)
          This method will create all combinations of matche configs that consists of 'numBotsInOneMatch' bots, i.e., all 1v1 (numBotsInOneMatch == 2) or all 1v1v1 (numBotsInOneMatch == 3), etc.
protected  void generate(List<UT2004DeathMatchConfig> result, int numBots, List<cz.cuni.amis.utils.token.IToken> botIds, int startFrom, List<cz.cuni.amis.utils.token.IToken> chosenBots)
           
protected  UT2004DeathMatchConfig[] generateMatches(int numBots)
           
 IUT2004BotConfig getBotConfig(cz.cuni.amis.utils.token.IToken botId)
          Returns bot configuration regardless it is custom (Pogamut) bot id or native UT2004 bot id.
 Map<cz.cuni.amis.utils.token.IToken,UT2004BotConfig> getBots()
          Map with custom (Pogamut) bots that are enlisted to the tournament.
 int getFragLimit()
          Used as UT2004DeathMatchConfig.setFragLimit(int).
 Map<cz.cuni.amis.utils.token.IToken,UT2004NativeBotConfig> getNativeBots()
          Map with native UT2004 bots that are enlisted to the tournament.
 int getNumBotsInOneMatch()
          How many bots should be present in one match.
 String getOutputDir()
          Used as UT2004DeathMatchConfig.setOutputDirectory(File).
 int getTimeLimitInMinutes()
          Used as UT2004DeathMatchConfig.setTimeLimit(int).
 cz.cuni.amis.utils.token.IToken getTournamentId()
          Used for unique identification of the tournament (optional).
 UCCWrapperConf getUccConf()
          UccConfiguration used for running ucc.exe for respective matches.
 boolean isNativeBot(cz.cuni.amis.utils.token.IToken botId)
           
 UT2004DeathMatchTournamentConfig setBot(UT2004BotConfig... bots)
          Sets bot configuration into the object, does not checks whether there is BotId clash.
 UT2004DeathMatchTournamentConfig setBots(Map<cz.cuni.amis.utils.token.IToken,UT2004BotConfig> bots)
           
 UT2004DeathMatchTournamentConfig setFragLimit(int fragLimit)
           
 UT2004DeathMatchTournamentConfig setMapName(String mapName)
           
 UT2004DeathMatchTournamentConfig setNativeBot(UT2004NativeBotConfig... bots)
          Sets native bot configuration into the object, does not checks whether there is BotId clash.
 UT2004DeathMatchTournamentConfig setNativeBots(Map<cz.cuni.amis.utils.token.IToken,UT2004NativeBotConfig> nativeBots)
           
 void setNumBotsInOneMatch(int numBotsInOneMatch)
           
 UT2004DeathMatchTournamentConfig setOutputDir(String outputDir)
           
 UT2004DeathMatchTournamentConfig setTimeLimitInMinutes(int timeLimitInMinutes)
           
 UT2004DeathMatchTournamentConfig setTournamentId(cz.cuni.amis.utils.token.IToken id)
           
 UT2004DeathMatchTournamentConfig setTournamentId(String id)
           
 void setUccConf(UCCWrapperConf uccConf)
           
 UT2004DeathMatchTournamentConfig setUnrealHome(String unrealHome)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

numBotsInOneMatch

protected int numBotsInOneMatch
How many bots should be present in one match.


tournamentId

protected cz.cuni.amis.utils.token.IToken tournamentId
Unique id of the tournament.


fragLimit

protected int fragLimit
Used as UT2004DeathMatchConfig.setFragLimit(int).


timeLimitInMinutes

protected int timeLimitInMinutes
Used as UT2004DeathMatchConfig.setTimeLimit(int).


uccConf

protected UCCWrapperConf uccConf

outputDir

protected String outputDir
Used as UT2004DeathMatchConfig.setOutputDirectory(File).

Example: "results" + File.separator + "tournament"


bots

protected Map<cz.cuni.amis.utils.token.IToken,UT2004BotConfig> bots
Custom (Pogamut) bots in the tournament.


nativeBots

protected Map<cz.cuni.amis.utils.token.IToken,UT2004NativeBotConfig> nativeBots
Native bots in the tournament.

Constructor Detail

UT2004DeathMatchTournamentConfig

public UT2004DeathMatchTournamentConfig()
Parameter-less constructor, don't forget to initialize everything!

Method Detail

getNumBotsInOneMatch

public int getNumBotsInOneMatch()
How many bots should be present in one match.

Returns:

getFragLimit

public int getFragLimit()
Used as UT2004DeathMatchConfig.setFragLimit(int).

Returns:

getTimeLimitInMinutes

public int getTimeLimitInMinutes()
Used as UT2004DeathMatchConfig.setTimeLimit(int).

Returns:

getTournamentId

public cz.cuni.amis.utils.token.IToken getTournamentId()
Used for unique identification of the tournament (optional).

Returns:

getOutputDir

public String getOutputDir()
Used as UT2004DeathMatchConfig.setOutputDirectory(File).

Returns:

getUccConf

public UCCWrapperConf getUccConf()
UccConfiguration used for running ucc.exe for respective matches.

Returns:

getBots

public Map<cz.cuni.amis.utils.token.IToken,UT2004BotConfig> getBots()
Map with custom (Pogamut) bots that are enlisted to the tournament.

Returns:

getNativeBots

public Map<cz.cuni.amis.utils.token.IToken,UT2004NativeBotConfig> getNativeBots()
Map with native UT2004 bots that are enlisted to the tournament.

Returns:

setNumBotsInOneMatch

public void setNumBotsInOneMatch(int numBotsInOneMatch)

setTournamentId

public UT2004DeathMatchTournamentConfig setTournamentId(cz.cuni.amis.utils.token.IToken id)

setTournamentId

public UT2004DeathMatchTournamentConfig setTournamentId(String id)

setFragLimit

public UT2004DeathMatchTournamentConfig setFragLimit(int fragLimit)

setTimeLimitInMinutes

public UT2004DeathMatchTournamentConfig setTimeLimitInMinutes(int timeLimitInMinutes)

setUnrealHome

public UT2004DeathMatchTournamentConfig setUnrealHome(String unrealHome)

setMapName

public UT2004DeathMatchTournamentConfig setMapName(String mapName)

setOutputDir

public UT2004DeathMatchTournamentConfig setOutputDir(String outputDir)

setUccConf

public void setUccConf(UCCWrapperConf uccConf)

setBots

public UT2004DeathMatchTournamentConfig setBots(Map<cz.cuni.amis.utils.token.IToken,UT2004BotConfig> bots)

setNativeBots

public UT2004DeathMatchTournamentConfig setNativeBots(Map<cz.cuni.amis.utils.token.IToken,UT2004NativeBotConfig> nativeBots)

clearBots

public UT2004DeathMatchTournamentConfig clearBots()

clearNativeBots

public UT2004DeathMatchTournamentConfig clearNativeBots()

addBot

public UT2004DeathMatchTournamentConfig addBot(UT2004BotConfig... bots)
Adds NEW bot configuration into the object, checks whether there is no BotId clash (if so, throws an exception).

Parameters:
bots -
Returns:

setBot

public UT2004DeathMatchTournamentConfig setBot(UT2004BotConfig... bots)
Sets bot configuration into the object, does not checks whether there is BotId clash.

Parameters:
bots -
Returns:

addNativeBot

public UT2004DeathMatchTournamentConfig addNativeBot(UT2004NativeBotConfig... bots)
Adds NEW native bot configuration into the object, checks whether there is no BotId clash (if so, throws an exception).

Parameters:
bots -
Returns:

setNativeBot

public UT2004DeathMatchTournamentConfig setNativeBot(UT2004NativeBotConfig... bots)
Sets native bot configuration into the object, does not checks whether there is BotId clash.

Parameters:
bots -
Returns:

isNativeBot

public boolean isNativeBot(cz.cuni.amis.utils.token.IToken botId)

getBotConfig

public IUT2004BotConfig getBotConfig(cz.cuni.amis.utils.token.IToken botId)
Returns bot configuration regardless it is custom (Pogamut) bot id or native UT2004 bot id.

Parameters:
botId -
Returns:

cleanUp

public void cleanUp()
WARNING: Removes directory with tournament results.


createConfiguration

public UT2004DeathMatchConfig createConfiguration(List<cz.cuni.amis.utils.token.IToken> chosenBots)
Creates UT2004DeathMatchConfig for bots of ids from 'chosenBots'.

Created configuration IS NOT VALIDATED!

Parameters:
chosenBots -
Returns:

generate

protected void generate(List<UT2004DeathMatchConfig> result,
                        int numBots,
                        List<cz.cuni.amis.utils.token.IToken> botIds,
                        int startFrom,
                        List<cz.cuni.amis.utils.token.IToken> chosenBots)

generateMatches

protected UT2004DeathMatchConfig[] generateMatches(int numBots)

createMatcheConfigs

public UT2004DeathMatchConfig[] createMatcheConfigs(int numBotsInOneMatch)
This method will create all combinations of matche configs that consists of 'numBotsInOneMatch' bots, i.e., all 1v1 (numBotsInOneMatch == 2) or all 1v1v1 (numBotsInOneMatch == 3), etc.

It does not create matche configs where there are only native UT2004 bots, there is always at least 1 custom (Pogamut) bot in every generated match configs.

Match configurations are NOT VALIDATED!

Parameters:
numBotsInOneMatch - must be >= 2
Returns:

createMatcheConfigs

public UT2004DeathMatchConfig[] createMatcheConfigs()
This method will create all combinations of matche configs that consists of 'numBotsInOneMatch' that is obtained via getNumBotsInOneMatch().

It does not create matche configs where there are only native UT2004 bots, there is always at least 1 custom (Pogamut) bot in every generated match configs.

Match configurations are NOT VALIDATED!

Returns:


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