org.eviline.randomizer
Class MaliciousRandomizer
java.lang.Object
org.eviline.randomizer.MaliciousRandomizer
- All Implemented Interfaces:
- Serializable, Randomizer
- Direct Known Subclasses:
- ThreadedMaliciousRandomizer
public class MaliciousRandomizer
- extends Object
- implements Randomizer, Serializable
Randomizer
that looks a few moves ahead in the future to come up with the worst
Shape
to return.
- Author:
- robin
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HISTORY_SIZE
public static final int HISTORY_SIZE
- See Also:
- Constant Field Values
config
protected MaliciousRandomizer.MaliciousRandomizerProperties config
randomFirst
protected boolean randomFirst
recent
protected List<ShapeType> recent
typeCounts
protected int[] typeCounts
history
protected List<ShapeType> history
distAdjustment
protected int distAdjustment
random
protected Random random
taunt
protected transient String taunt
MaliciousRandomizer
public MaliciousRandomizer(PropertySource p)
depth
public int depth()
rfactor
public double rfactor()
fair
public boolean fair()
distribution
public int distribution()
provideShape
public Shape provideShape(Field field)
- Description copied from interface:
Randomizer
- Return the
Shape
to be next played on the argument Field
- Specified by:
provideShape
in interface Randomizer
- Returns:
getTaunt
public String getTaunt()
- Specified by:
getTaunt
in interface Randomizer
getNext
public List<ShapeType> getNext()
- Specified by:
getNext
in interface Randomizer
decide
protected Decision decide(Field field,
String taunt,
int depth)
worstFor
protected Decision worstFor(Field field,
String taunt,
int depth)
permuteDecision
protected void permuteDecision(Decision typeDecision)
getRandom
public Random getRandom()
setRandom
public void setRandom(Random random)
config
public PropertySource config()
- Specified by:
config
in interface Randomizer
name
public String name()
- Specified by:
name
in interface Randomizer
Copyright © 2013. All Rights Reserved.