public class UT2004DeathMatch1v1 extends Object implements Callable<UT2004DeathMatchResult>, Runnable
You may run it inside thread by invoking new Thread(ut2004DeathMatch1v1).start() or use with ThreadPoolExecutor as it
is implementing Callable.
But you will usually want just to execute it using call().
Encapsulates classes: UT2004DeathMatch, UT2004DeathMatchConfig, UT2004BotConfig and UCCWrapperConf.
If you want to know how all instanes of UT2004DeathMatch configuration are setup, see configure1Vs1()
code.
| Constructor and Description |
|---|
UT2004DeathMatch1v1()
Parameter-less constructor, don't forget to initialize everything!
|
UT2004DeathMatch1v1(String matchName)
Match-name only constructor, don't forget to initialize everything!
|
UT2004DeathMatch1v1(String unrealHome,
String mapName,
String bot1Name,
String bot1JarPath,
String bot2Name,
String bot2JarPath)
Initializes all needed fields for combat of 2 bots.
|
| Modifier and Type | Method and Description |
|---|---|
UT2004DeathMatchResult |
call() |
void |
cleanUp()
Removes directory with match results, called automatically in
run(). |
protected UT2004DeathMatchConfig |
configure1Vs1()
Contains main code that setups the
UT2004DeathMatchConfig, UT2004BotConfig and UCCWrapper
instances (it might be interesting for you to check the code for yourself if you wish to customize it further...). |
UT2004DeathMatch |
createMatch()
Creates new instance of
UT2004DeathMatch with desired configuration + validates it (i.e., if it won't throw an exception
you may be sure, that the UT2004DeathMatch instance is correctly configured). |
String |
getBot1JarPath()
Used as
UT2004BotExecutionConfig.setPathToBotJar(String) for the first bot. |
String |
getBot1Name()
Used as
UT2004BotConfig.setBotId(String) for the first bot. |
String |
getBot2JarPath()
Used as
UT2004BotExecutionConfig.setPathToBotJar(String) for the second bot. |
String |
getBot2Name()
Used as
UT2004BotConfig.setBotId(String) for the second bot. |
Throwable |
getException()
If
run() terminates with an exception, it will be made available through this getter. |
int |
getFragLimit()
|
cz.cuni.amis.pogamut.base.utils.logging.LogCategory |
getLog()
Logger used for outputting info about the match.
|
String |
getMapName()
Used as
UCCWrapperConf.setMapName(String). |
String |
getMatchName()
Used as
UT2004MatchConfig.setMatchId(String). |
String |
getOutputDir()
|
UT2004DeathMatchResult |
getResult()
Last result of the match.
|
int |
getTimeLimitInMinutes()
|
String |
getUnrealHome()
Used as
UCCWrapperConf.setMapName(String). |
void |
run()
Executes the match.
|
UT2004DeathMatch1v1 |
setBot1JarPath(String bot1JarPath) |
UT2004DeathMatch1v1 |
setBot1Name(String bot1Name) |
UT2004DeathMatch1v1 |
setBot2JarPath(String bot2JarPath) |
UT2004DeathMatch1v1 |
setBot2Name(String bot2Name) |
UT2004DeathMatch1v1 |
setFragLimit(int fragLimit) |
void |
setLog(cz.cuni.amis.pogamut.base.utils.logging.LogCategory log)
Sets logger used for outputting info about the match.
|
UT2004DeathMatch1v1 |
setMapName(String mapName) |
UT2004DeathMatch1v1 |
setMatchName(String matchName) |
UT2004DeathMatch1v1 |
setOutputDir(String outputDir) |
UT2004DeathMatch1v1 |
setTimeLimitInMinutes(int timeLimitInMinutes) |
UT2004DeathMatch1v1 |
setUnrealHome(String unrealHome) |
public UT2004DeathMatch1v1()
public UT2004DeathMatch1v1(String matchName)
public UT2004DeathMatch1v1(String unrealHome, String mapName, String bot1Name, String bot1JarPath, String bot2Name, String bot2JarPath)
Used time limit: 20 minutes,
Used frag limit: 20
Recommended mapName: DM-1on1-Albatross
unrealHome - mapName - bot1Name - bot1JarPath - bot2Name - bot2JarPath - public cz.cuni.amis.pogamut.base.utils.logging.LogCategory getLog()
If you want to output stuff to console, use LogCategory.addConsoleHandler().
public int getFragLimit()
public int getTimeLimitInMinutes()
public String getMatchName()
UT2004MatchConfig.setMatchId(String).public String getBot1Name()
UT2004BotConfig.setBotId(String) for the first bot.public String getBot1JarPath()
UT2004BotExecutionConfig.setPathToBotJar(String) for the first bot.public String getBot2Name()
UT2004BotConfig.setBotId(String) for the second bot.public String getBot2JarPath()
UT2004BotExecutionConfig.setPathToBotJar(String) for the second bot.public String getUnrealHome()
UCCWrapperConf.setMapName(String).public String getMapName()
UCCWrapperConf.setMapName(String).public String getOutputDir()
public UT2004DeathMatchResult getResult()
run().public Throwable getException()
run() terminates with an exception, it will be made available through this getter.public void setLog(cz.cuni.amis.pogamut.base.utils.logging.LogCategory log)
log - public UT2004DeathMatch1v1 setFragLimit(int fragLimit)
public UT2004DeathMatch1v1 setTimeLimitInMinutes(int timeLimitInMinutes)
public UT2004DeathMatch1v1 setMatchName(String matchName)
public UT2004DeathMatch1v1 setBot1Name(String bot1Name)
public UT2004DeathMatch1v1 setBot1JarPath(String bot1JarPath)
public UT2004DeathMatch1v1 setBot2Name(String bot2Name)
public UT2004DeathMatch1v1 setBot2JarPath(String bot2JarPath)
public UT2004DeathMatch1v1 setUnrealHome(String unrealHome)
public UT2004DeathMatch1v1 setMapName(String mapName)
public UT2004DeathMatch1v1 setOutputDir(String outputDir)
public void cleanUp()
run().protected UT2004DeathMatchConfig configure1Vs1()
UT2004DeathMatchConfig, UT2004BotConfig and UCCWrapper
instances (it might be interesting for you to check the code for yourself if you wish to customize it further...).public UT2004DeathMatch createMatch()
UT2004DeathMatch with desired configuration + validates it (i.e., if it won't throw an exception
you may be sure, that the UT2004DeathMatch instance is correctly configured).public void run()
cleanUp(), than it configures UT2004DeathMatch via createMatch()
and UT2004DeathMatch.execute()s it.
If no exception occurs during the match (== match will successfully finish), match result will be available through getResult().
If exception occurs (due to whatever reason), this exception will be available through getException().
public UT2004DeathMatchResult call() throws Exception
call in interface Callable<UT2004DeathMatchResult>ExceptionCopyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.