|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.colossus.ai.helper.OnTheFlyLegionMove
public class OnTheFlyLegionMove
On-the-fly generation of the Collection of all possible LegionMove. This doesn't fully respect the Collection interface: The random generation may fail before all elements have been returned, so to iterators may return different subsets of the entire collection. Also, this may cause size() to return a value higher than what is really accessible.
Nested Class Summary | |
---|---|
(package private) class |
OnTheFlyLegionMove.OnTheFlyLegionMoveIterator
|
Field Summary | |
---|---|
private java.util.List<java.util.List<CritterMove>> |
allCritterMoves
|
private static int |
GOOD_PARENT_TOP_PERCENT
Percentage from the top (of the already avaluated space) to pick a 'good' parent. |
private static java.util.logging.Logger |
LOGGER
|
private static long |
MIN_MEMORY_REFILL
Amount of memory needed before a refill. |
private static int |
MIN_PARENT_CHOICE
Minimum number of possible 'good' parents. |
private int |
mysize
|
private static int |
RANDOM_GENE_PERCENT
Percentage that a gene will be random instead of inherited. |
private static int |
RANDOM_MAX_TRY
Maximum number of try before giving up generating a new element. |
private static int |
RANDOM_PARENT_PERCENT
Percentage of a randomly chosen parent. |
private static int |
REFILL_SIZE
number of elements to put in each new batch of element. |
private static int |
SPONTANEOUS_GENERATION_PERCENT
Percentage of fully random new elements This helps diversifying the gene pool. |
Constructor Summary | |
---|---|
OnTheFlyLegionMove(java.util.List<java.util.List<CritterMove>> acm)
|
Method Summary | ||
---|---|---|
boolean |
add(LegionMove o)
|
|
boolean |
addAll(java.util.Collection<? extends LegionMove> c)
|
|
void |
clear()
|
|
boolean |
contains(java.lang.Object o)
|
|
boolean |
containsAll(java.util.Collection<?> c)
|
|
boolean |
equals(java.lang.Object o)
|
|
(package private) int |
getDim()
|
|
int |
hashCode()
|
|
boolean |
isEmpty()
|
|
java.util.Iterator<LegionMove> |
iterator()
|
|
boolean |
remove(java.lang.Object o)
|
|
boolean |
removeAll(java.util.Collection<?> c)
|
|
boolean |
retainAll(java.util.Collection<?> c)
|
|
int |
size()
|
|
java.lang.Object[] |
toArray()
|
|
|
toArray(T[] a)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int RANDOM_MAX_TRY
private static final int REFILL_SIZE
private static final int RANDOM_GENE_PERCENT
private static final int RANDOM_PARENT_PERCENT
private static final int GOOD_PARENT_TOP_PERCENT
private static final int MIN_PARENT_CHOICE
private static final int SPONTANEOUS_GENERATION_PERCENT
private static final long MIN_MEMORY_REFILL
private static final java.util.logging.Logger LOGGER
private final java.util.List<java.util.List<CritterMove>> allCritterMoves
private final int mysize
Constructor Detail |
---|
public OnTheFlyLegionMove(java.util.List<java.util.List<CritterMove>> acm)
Method Detail |
---|
int getDim()
public boolean add(LegionMove o)
add
in interface java.util.Collection<LegionMove>
public boolean addAll(java.util.Collection<? extends LegionMove> c)
addAll
in interface java.util.Collection<LegionMove>
public void clear()
clear
in interface java.util.Collection<LegionMove>
public boolean contains(java.lang.Object o)
contains
in interface java.util.Collection<LegionMove>
public boolean containsAll(java.util.Collection<?> c)
containsAll
in interface java.util.Collection<LegionMove>
public boolean equals(java.lang.Object o)
equals
in interface java.util.Collection<LegionMove>
equals
in class java.lang.Object
public int hashCode()
hashCode
in interface java.util.Collection<LegionMove>
hashCode
in class java.lang.Object
public boolean isEmpty()
isEmpty
in interface java.util.Collection<LegionMove>
public java.util.Iterator<LegionMove> iterator()
iterator
in interface java.lang.Iterable<LegionMove>
iterator
in interface java.util.Collection<LegionMove>
public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection<LegionMove>
public boolean removeAll(java.util.Collection<?> c)
removeAll
in interface java.util.Collection<LegionMove>
public boolean retainAll(java.util.Collection<?> c)
retainAll
in interface java.util.Collection<LegionMove>
public int size()
size
in interface java.util.Collection<LegionMove>
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection<LegionMove>
public <T> T[] toArray(T[] a)
toArray
in interface java.util.Collection<LegionMove>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |