megamek.client.bot
Class GAAttack
java.lang.Object
megamek.client.bot.ga.GA
megamek.client.bot.GAAttack
public class GAAttack
- extends GA
Need to test the function that moves all firing to a single target
|
Constructor Summary |
GAAttack(TestBot tb,
CEntity attacker,
java.util.ArrayList<java.util.ArrayList<AttackOption>> attack,
int population,
int generations,
boolean isEnemy)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
attack
protected java.util.ArrayList<java.util.ArrayList<AttackOption>> attack
attacker
protected CEntity attacker
game
protected IGame game
targets
protected CEntity.Table targets
target_array
protected java.util.ArrayList<Entity> target_array
valid_target_indexes
protected java.util.ArrayList<java.lang.Integer> valid_target_indexes
overheat_eligible
protected boolean overheat_eligible
firing_arc
protected int firing_arc
damages
double[] damages
GAAttack
public GAAttack(TestBot tb,
CEntity attacker,
java.util.ArrayList<java.util.ArrayList<AttackOption>> attack,
int population,
int generations,
boolean isEnemy)
getResultChromosome
public int[] getResultChromosome()
getDamageUtility
public double getDamageUtility(CEntity to)
getDamageUtilities
public double[] getDamageUtilities()
getFitness
protected double getFitness(int iChromIndex)
- Specified by:
getFitness in class GA
getFitness
protected double getFitness(Chromosome chromArrayList)
doRandomMutation
protected void doRandomMutation(int iChromIndex)
- since the low fitness members have the least chance of getting selected,
but the highest chance of mutation, this is where we use the primary
target heuristic to drive convergence
- Specified by:
doRandomMutation in class GA
initPopulation
protected void initPopulation()
- Specified by:
initPopulation in class GA
getFiringArc
public int getFiringArc()
setFiringArc
public void setFiringArc(int firing_arc)
getAttack
public java.util.ArrayList<java.util.ArrayList<AttackOption>> getAttack()