class OnTheFlyLegionMove.OnTheFlyLegionMoveIterator extends java.lang.Object implements java.util.Iterator<LegionMove>
Modifier and Type | Class and Description |
---|---|
(package private) class |
OnTheFlyLegionMove.OnTheFlyLegionMoveIterator.myIntArrayComparator |
(package private) class |
OnTheFlyLegionMove.OnTheFlyLegionMoveIterator.myIntArrayLegionValueComparator |
Modifier and Type | Field and Description |
---|---|
private boolean |
abort |
private java.util.SortedMap<int[],LegionMove> |
alreadydone
map from indexes to LegionMove, what we have already sent to the AI
|
private java.util.SortedMap<int[],LegionMove> |
beingdone
map from indexes to LegionMove, the next batch to send to the AI
|
private java.util.List<int[]> |
byValues
already done & evaluated, sorted by legion value
|
private OnTheFlyLegionMove.OnTheFlyLegionMoveIterator.myIntArrayLegionValueComparator |
byValuesComparator |
private OnTheFlyLegionMove |
daddy |
private int |
dim |
private boolean |
failoverOnly |
private java.util.Set<java.lang.Integer>[][][] |
incomps
The 'incompatibility map'.
|
private int[] |
lastDense
deterministically make up a on-used combination
|
private int[] |
lastone
the previously returned object
|
private java.util.Random |
rand |
Constructor and Description |
---|
OnTheFlyLegionMove.OnTheFlyLegionMoveIterator(OnTheFlyLegionMove d) |
Modifier and Type | Method and Description |
---|---|
private int[] |
breed(int[] mom,
int[] dad,
int percentRandom)
breed a combination from parents
|
private void |
buildIncompMap() |
private int[] |
failoverGeneration() |
protected void |
finalize() |
private int |
firstfill()
fill beingdone with the first, supposedly most interesting
combinatione.
|
private int[] |
geneticGeneration()
create a genetic combination
|
private int[] |
getParent(int percentRandom,
int percentTop)
pick a parent
|
boolean |
hasNext() |
private int |
higherRankIncomp(int[] indexes) |
(package private) java.lang.String |
intArrayToString(int[] t) |
private boolean |
isBad(int[] indexes) |
LegionMove |
next() |
private int |
recurseGenerate(int index,
int[] counts,
int[] actual)
full recursive generation
|
private int |
refill(int n)
fill beingdone with up to n genetically generated, not-yet-done
combinations.
|
void |
remove() |
private int[] |
spontaneousGeneration()
create a fully random combination
|
private final java.util.SortedMap<int[],LegionMove> alreadydone
private final java.util.List<int[]> byValues
private final OnTheFlyLegionMove.OnTheFlyLegionMoveIterator.myIntArrayLegionValueComparator byValuesComparator
private int[] lastone
private final java.util.SortedMap<int[],LegionMove> beingdone
private final OnTheFlyLegionMove daddy
private final java.util.Random rand
private final int dim
private boolean abort
private boolean failoverOnly
private final java.util.Set<java.lang.Integer>[][][] incomps
private int[] lastDense
OnTheFlyLegionMove.OnTheFlyLegionMoveIterator(OnTheFlyLegionMove d)
java.lang.String intArrayToString(int[] t)
private void buildIncompMap()
public boolean hasNext()
hasNext
in interface java.util.Iterator<LegionMove>
private int higherRankIncomp(int[] indexes)
private boolean isBad(int[] indexes)
private int recurseGenerate(int index, int[] counts, int[] actual)
private int firstfill()
private int[] failoverGeneration()
private int[] spontaneousGeneration()
private int[] geneticGeneration()
private int[] getParent(int percentRandom, int percentTop)
private int[] breed(int[] mom, int[] dad, int percentRandom)
private int refill(int n)
n
- The number of requeste combinations.public LegionMove next()
next
in interface java.util.Iterator<LegionMove>
public void remove()
remove
in interface java.util.Iterator<LegionMove>
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable