Package edu.wisc.game.sql
Class RandomGameGenerator
- java.lang.Object
-
- edu.wisc.game.sql.GameGenerator
-
- edu.wisc.game.sql.RandomGameGenerator
-
public class RandomGameGenerator extends GameGenerator
This class generates random games (with the same rule set and randomly created initial boards) based on the provided parameter range specifications
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class edu.wisc.game.sql.GameGenerator
GameGenerator.Features
-
-
Constructor Summary
Constructors Constructor Description RandomGameGenerator(RandomRG _random, File ruleSetFile, int[] _nPiecesRange, int[] _nShapesRange, int[] _nColorsRange, Piece.Shape[] _allShapes, Piece.Color[] _allColors)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static GameGenerator
buildFromArgv(RandomRG _random, File f, ParseConfig ht, String[] argv, int ja)
Builds a RandomGameGenerator from command-line arguments.static void
main(String[] argv)
Creates a bunch of random boards, from which one can later select those matching some additional criteria, and use them in an experiment plan with predefined boards.Game
nextGame()
Generates a game with a random initial board, in accordance with this generator's parametersstatic String
rangeToString(int[] range)
String
toString()
-
Methods inherited from class edu.wisc.game.sql.GameGenerator
advance, extraToString, getAllFeatures, getRules, getTesting, mkGameGenerator, setConditions, setConditionsFromHT, setConditionsFromParaSet, setTesting
-
-
-
-
Constructor Detail
-
RandomGameGenerator
public RandomGameGenerator(RandomRG _random, File ruleSetFile, int[] _nPiecesRange, int[] _nShapesRange, int[] _nColorsRange, Piece.Shape[] _allShapes, Piece.Color[] _allColors) throws IOException, RuleParseException
- Throws:
IOException
RuleParseException
-
-
Method Detail
-
rangeToString
public static String rangeToString(int[] range)
-
nextGame
public Game nextGame()
Generates a game with a random initial board, in accordance with this generator's parameters- Specified by:
nextGame
in classGameGenerator
-
buildFromArgv
public static GameGenerator buildFromArgv(RandomRG _random, File f, ParseConfig ht, String[] argv, int ja) throws IOException, RuleParseException, IllegalInputException, ReflectiveOperationException
Builds a RandomGameGenerator from command-line arguments. Used in Captive Game Server, and for various other tools, such as the command-line random board generator.- Parameters:
f
- If specified, this is the rule set file to use. It can be null, if you just need the generator to create boards, and not to play a game.ja
- Use argv[ja:...]. This can contain either (trialListFile, rowNo), or (nPieceRanges, ...)- Throws:
IOException
RuleParseException
IllegalInputException
ReflectiveOperationException
-
main
public static void main(String[] argv) throws IOException, RuleParseException, ReflectiveOperationException, IllegalInputException
Creates a bunch of random boards, from which one can later select those matching some additional criteria, and use them in an experiment plan with predefined boards.
-
-