|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.colossus.ai.helper.OnTheFlyLegionMove.OnTheFlyLegionMoveIterator
class OnTheFlyLegionMove.OnTheFlyLegionMoveIterator
Nested Class Summary | |
---|---|
(package private) class |
OnTheFlyLegionMove.OnTheFlyLegionMoveIterator.myIntArrayComparator
|
(package private) class |
OnTheFlyLegionMove.OnTheFlyLegionMoveIterator.myIntArrayLegionValueComparator
|
Field Summary | |
---|---|
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 Summary | |
---|---|
OnTheFlyLegionMove.OnTheFlyLegionMoveIterator(OnTheFlyLegionMove d)
|
Method Summary | |
---|---|
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
OnTheFlyLegionMove.OnTheFlyLegionMoveIterator(OnTheFlyLegionMove d)
Method Detail |
---|
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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |