Package edu.wisc.game.sql
Class GameGenerator
- java.lang.Object
-
- edu.wisc.game.sql.GameGenerator
-
- Direct Known Subclasses:
PredefinedBoardGameGenerator
,RandomGameGenerator
,RandomImageGameGenerator
,TrivialGameGenerator
public abstract class GameGenerator extends Object
A GameGenerator 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 Modifier and Type Class Description static class
GameGenerator.Features
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
advance(int n)
Advances the counter.String
extraToString()
More info to be added to toString()GameGenerator.Features
getAllFeatures()
For Captive server, to be priented via JSON Reflect.RuleSet
getRules()
boolean
getTesting()
static GameGenerator
mkGameGenerator(RandomRG _random, ParaSet para)
Creates a GameGenerator based on a parameter set.abstract Game
nextGame()
Generates the next game to playvoid
setConditions(boolean _testing, RuleSet _condRules)
For the training/testing restrictions on boards, as introduced in GS 6.010.void
setConditionsFromHT(ParseConfig ht)
Sets the constraints if they are specified in the command-line optionsvoid
setConditionsFromParaSet(ParaSet para)
Sets the constraints if they are specified in the parameter setvoid
setTesting(boolean _testing)
-
-
-
Method Detail
-
getRules
public RuleSet getRules()
-
nextGame
public abstract Game nextGame()
Generates the next game to play
-
advance
public void advance(int n)
Advances the counter. This can be used to resume an interrupted series, so that e.g. a predefined board from the correct position in the list would be used next.- Parameters:
n
- advance the counter as if n games have been created
-
mkGameGenerator
public static GameGenerator mkGameGenerator(RandomRG _random, ParaSet para) throws IOException, RuleParseException, IllegalInputException, ReflectiveOperationException
Creates a GameGenerator based on a parameter set. Depending on which parameters are set, a PredefinedBoardGameGenerator or a RandomGameGenerator may be returned.- Parameters:
para
- The parameter set for which we will create a suitable GameGenerator- Throws:
IOException
RuleParseException
IllegalInputException
ReflectiveOperationException
-
getTesting
public boolean getTesting()
-
setTesting
public void setTesting(boolean _testing)
-
setConditions
public void setConditions(boolean _testing, RuleSet _condRules)
For the training/testing restrictions on boards, as introduced in GS 6.010. See email discusion with Paul on 2023-03-08, and captive.html#cond
-
extraToString
public String extraToString()
More info to be added to toString()
-
getAllFeatures
public GameGenerator.Features getAllFeatures()
For Captive server, to be priented via JSON Reflect.
-
setConditionsFromHT
public void setConditionsFromHT(ParseConfig ht) throws IOException, IllegalInputException, RuleParseException
Sets the constraints if they are specified in the command-line options- Parameters:
ht
- contains command-line options- Throws:
IOException
IllegalInputException
RuleParseException
-
setConditionsFromParaSet
public void setConditionsFromParaSet(ParaSet para) throws IOException, IllegalInputException, RuleParseException
Sets the constraints if they are specified in the parameter set- Parameters:
para
- Parameter set- Throws:
IOException
IllegalInputException
RuleParseException
-
-