megamek.client.bot
Class GAAttack

java.lang.Object
  extended by megamek.client.bot.ga.GA
      extended by megamek.client.bot.GAAttack

public class GAAttack
extends GA

Need to test the function that moves all firing to a single target


Field Summary
protected  java.util.ArrayList<java.util.ArrayList<AttackOption>> attack
           
protected  CEntity attacker
           
(package private)  double[] damages
           
protected  int firing_arc
           
protected  IGame game
           
protected  boolean overheat_eligible
           
protected  java.util.ArrayList<Entity> target_array
           
protected  CEntity.Table targets
           
protected  java.util.ArrayList<java.lang.Integer> valid_target_indexes
           
 
Fields inherited from class megamek.client.bot.ga.GA
best, chromosomeDim, chromosomes, populationDim
 
Constructor Summary
GAAttack(TestBot tb, CEntity attacker, java.util.ArrayList<java.util.ArrayList<AttackOption>> attack, int population, int generations, boolean isEnemy)
           
 
Method Summary
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
 java.util.ArrayList<java.util.ArrayList<AttackOption>> getAttack()
           
 double[] getDamageUtilities()
           
 double getDamageUtility(CEntity to)
           
 int getFiringArc()
           
protected  double getFitness(Chromosome chromArrayList)
           
protected  double getFitness(int iChromIndex)
           
 int[] getResultChromosome()
           
protected  void initPopulation()
           
 void setFiringArc(int firing_arc)
           
 
Methods inherited from class megamek.client.bot.ga.GA
doExhaustiveSearch, doHeuristicPass, evolve, getAvgFitness, getESquared, getFittestChromosomesFitness, selectTwoParents, shouldDoExhaustive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

GAAttack

public GAAttack(TestBot tb,
                CEntity attacker,
                java.util.ArrayList<java.util.ArrayList<AttackOption>> attack,
                int population,
                int generations,
                boolean isEnemy)
Method Detail

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()