public abstract class GeneticAlgorithm extends Metaheuristic
| Modifier and Type | Field and Description |
|---|---|
AlgHelper |
algHelper |
protected java.lang.String |
algSubtype |
protected int |
binStringLength |
protected CrossoverHelper |
crossover
Crossover Strategy Field
|
static int |
CROSSOVER_TYPE_BLOCK_UNIFORM |
static int |
CROSSOVER_TYPE_ONEPOINT |
static int |
CROSSOVER_TYPE_TWOPOINT |
static int |
CROSSOVER_TYPE_UNIFORM |
static java.lang.String[] |
CrossoverTypeList |
static int |
DEFAULT_CROSSOVER_TYPE |
static int |
DEFAULT_ELITISIM_TYPE |
static float |
DEFAULT_ELITISM_PERCENT |
static int |
DEFAULT_MUTATION_NUMBER |
static float |
DEFAULT_MUTATION_PERCENT |
static int |
DEFAULT_MUTATION_TYPE |
static int |
DEFAULT_POP_SIZE |
static float |
DEFAULT_PRESERVE_PERCENT |
static int |
DEFAULT_PRESERVE_TYPE |
static int |
DEFAULT_SELECTION_TYPE |
protected ElitismHelper |
elitism
ElitismHelper Strategy Field
|
static int |
ELITISM_TYPE_NONE |
static int |
ELITISM_TYPE_PERCENTAGE |
static java.lang.String[] |
ElitismTypeList |
protected int |
genSinceImprovement |
float |
lambda1 |
float |
lambda2 |
float |
MUTATION_PERCENT |
static int |
MUTATION_TYPE_BOUNDARY |
static int |
MUTATION_TYPE_GUASSIAN |
static int |
MUTATION_TYPE_NONUNIFORM |
static int |
MUTATION_TYPE_PG |
static int |
MUTATION_TYPE_PU |
static int |
MUTATION_TYPE_SG |
static int |
MUTATION_TYPE_SMOOTH |
static int |
MUTATION_TYPE_SU |
static int |
MUTATION_TYPE_UNIFORM |
static java.lang.String[] |
MutationTypeList |
protected Mutation |
mutator
Mutation Strategy Field
|
protected static int |
nameIndex |
int |
objectiveType |
protected int |
popSize
Integer size of the population
|
protected Population |
population
Population instance of organisms for the algorithm
|
static int |
PRESERVE_TYPE_NONE |
static int |
PRESERVE_TYPE_PCT_RAND |
protected float |
preservePct
Percent of each generation to be randomly preserved and moved to next
generation
|
protected PreserveHelper |
preserver
PreserveHelper Strategy Field
|
static java.lang.String[] |
PreserveTypeList |
SearchSpace |
searchSpace |
static int |
SELECTION_TYPE_EP |
static int |
SELECTION_TYPE_RANDOM |
static int |
SELECTION_TYPE_ROULETTE |
static int |
SELECTION_TYPE_TOURNAMENT |
static java.lang.String[] |
SelectionTypeList |
protected SelectionHelper |
selector
Selection Strategy Field
|
static java.lang.String |
TYPE_SGA |
float |
w1 |
float |
w2 |
float |
w3 |
MODEL_TYPES, numBestSolutionsSaved, rng, type, TYPE_CAPACITY, TYPE_CAPACITY_FULL, TYPE_DEMAND_HYBRID, TYPE_DEMAND_HYBRID_CDP, TYPE_NDIST_DEMAND, TYPE_NDIST_DEMAND_CDP, TYPE_PROFILE_BASED, TYPE_PROFILE_BASED_CDPDEFAULT_AF_RANGE, DEFAULT_AF_STEP, DEFAULT_CDP_MIN, DEFAULT_CDP_RANGE, DEFAULT_CDP_STEP, DEFAULT_JD_MIN, DEFAULT_JD_RANGE, DEFAULT_JD_STEP, DEFAULT_MAX_ITERATIONS, DEFUALT_AF_MIN, isAdaptive, isMemetic, MAX_ITER, name, numIter, numParallelSeeds, optimalTol, stats, useParallel| Constructor and Description |
|---|
GeneticAlgorithm() |
GeneticAlgorithm(int popSize) |
GeneticAlgorithm(java.lang.String name,
int popSize) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
convertToBinString(float newAF) |
float |
getAF_MAX(int type,
int seg,
int per) |
float |
getAF_MIN(int type,
int seg,
int per) |
int |
getAF_RANGE(int type,
int seg,
int per) |
float |
getAF_STEP(int type,
int seg,
int per) |
Organism |
getBestOrganism()
Returns the best organism that has been found.
|
java.lang.String |
getBinString(int intToConvert) |
static java.lang.String |
getBinString(int intToConvert,
int numDigits) |
int |
getBinStringLength() |
CrossoverHelper |
getCrossover()
Getter for the CrossoverHelper operator
|
ElitismHelper |
getElitism()
Getter for the ElitismHelper operator.
|
int |
getElitismNumberSelected() |
int |
getGenSinceImprovement() |
int |
getIterationCount() |
Mutation |
getMutator()
Getter for the Mutation operator.
|
java.lang.String |
getName() |
int |
getNumBestSolutionsSaved() |
Population |
getPopulation() |
Seed |
getPopulationSeed(int seedIndex) |
int |
getPreservationNumberSelected() |
float |
getPreservePct()
Getter for the algorithm organism preservation percentage.
|
PreserveHelper |
getPreserver()
Getter for the PreserveHelper operator.
|
java.util.Random |
getRNG() |
SelectionHelper |
getSelector()
Getter for the SelectionHelper operator.
|
int |
getSize() |
Seed |
getSolnSeed()
Returns the Seed file with the best found solution applied to it.
|
void |
initialize(AlgHelper fh,
Seed[] seed)
Initializes the algorithm
|
void |
initialize(AlgHelper fh,
Seed[] seed,
boolean createNewSearchSpace) |
private void |
initialize(Population population) |
void |
initialize(Seed targetSeed,
Seed[] seed)
Initializes the algorithm
|
void |
initialize(Seed targetSeed,
Seed[] seed,
boolean createNewSearchSpace) |
void |
setAlgSubtype(java.lang.String subtype)
Specifies the subtype of the of GA
|
void |
setBGASearchSpace(int segment,
FloatProfile prof)
Uses the profile and the binary string length to determine a search space
genetic algorithm with a binary encoding.
|
void |
setBinStringLength(int binStringLength) |
void |
setCrossoverStrategy(CrossoverHelper crossover)
Direct Setter for the CrossoverHelper operator.
|
void |
setCrossoverStrategy(int crossoverStrategy)
Setter for the crossover operator (use static fields).
|
void |
setElitismStrategy(ElitismHelper elitism)
Setter for the Elitism operator.
|
void |
setElitismStrategy(int elitismStrategy)
Setter for the Elitism operator with default values (use static fields).
|
void |
setGenSinceImprovement(int newVal) |
void |
setMutationStrategy(int mutationStrategy)
Setter for the mutator operator (use static fields).
|
void |
setMutationStrategy(Mutation mutator)
Direct Setter for the CrossoverHelper operator.
|
void |
setNumBestSolutionsSaved(int numBestSolutionsSaved) |
void |
setPopulationSize(int popSize)
Deprecated.
|
void |
setPreservationStrategy(int preserveStrategy)
Setter for the PreserveHelper operator with default values (use static
fields).
|
void |
setPreservePct(float preservePct)
Setter for the organism algorithm preservation percentage.
|
void |
setPreserveStrategy(PreserveHelper preserver)
Setter for the Preserve operator.
|
void |
setRNGSeed(int rngSeed) |
void |
setRNGSeed(long rngSeed) |
void |
setRVGASearchSpace(int segment,
FloatProfile prof,
float step)
Uses the profile and the specified step size to determine a search space
genetic algorithm with a real valued encoding.
|
void |
setSelectionStrategy(int selectionStrategy)
Setter for the SelectionHelper operator with default values (use static
fields).
|
void |
setSelectionStrategy(SelectionHelper selector)
Setter for the Selection operator.
|
setTypegetAF_MAX, getAF_MIN, getAF_RANGE, getAF_STEP, getCDP_MAX, getCDP_MIN, getCDP_RANGE, getCDP_STEP, getJD_MAX, getJD_MIN, getJD_RANGE, getJD_STEP, getMAX_ITER, getNumParallelSeeds, getOptimalTol, isAdaptive, isMemetic, isUseParallel, setAdaptive, setAF_MIN, setAF_RANGE, setAF_STEP, setCDP_MIN, setCDP_RANGE, setCDP_STEP, setJD_MIN, setJD_RANGE, setJD_STEP, setMAX_ITER, setMemetic, setName, setNumParallelSeeds, setOptimalTol, setUseParallel, solveInstance, solveInstance, toStringprotected final int popSize
protected Population population
protected ElitismHelper elitism
protected PreserveHelper preserver
protected SelectionHelper selector
protected CrossoverHelper crossover
protected Mutation mutator
public SearchSpace searchSpace
protected java.lang.String algSubtype
protected int genSinceImprovement
public AlgHelper algHelper
public int objectiveType
public float w1
public float w2
public float w3
public float lambda1
public float lambda2
protected float preservePct
protected int binStringLength
protected static int nameIndex
public static final int ELITISM_TYPE_NONE
public static final int ELITISM_TYPE_PERCENTAGE
public static final java.lang.String[] ElitismTypeList
public static final int PRESERVE_TYPE_NONE
public static final int PRESERVE_TYPE_PCT_RAND
public static final java.lang.String[] PreserveTypeList
public static final int SELECTION_TYPE_TOURNAMENT
public static final int SELECTION_TYPE_ROULETTE
public static final int SELECTION_TYPE_EP
public static final int SELECTION_TYPE_RANDOM
public static final java.lang.String[] SelectionTypeList
public static final int CROSSOVER_TYPE_ONEPOINT
public static final int CROSSOVER_TYPE_TWOPOINT
public static final int CROSSOVER_TYPE_UNIFORM
public static final int CROSSOVER_TYPE_BLOCK_UNIFORM
public static final java.lang.String[] CrossoverTypeList
public static final int MUTATION_TYPE_UNIFORM
public static final int MUTATION_TYPE_NONUNIFORM
public static final int MUTATION_TYPE_BOUNDARY
public static final int MUTATION_TYPE_GUASSIAN
public static final int MUTATION_TYPE_SMOOTH
public static final int MUTATION_TYPE_SG
public static final int MUTATION_TYPE_SU
public static final int MUTATION_TYPE_PG
public static final int MUTATION_TYPE_PU
public static final java.lang.String[] MutationTypeList
public static final int DEFAULT_POP_SIZE
public static final int DEFAULT_ELITISIM_TYPE
public static final int DEFAULT_PRESERVE_TYPE
public static final int DEFAULT_SELECTION_TYPE
public static final int DEFAULT_CROSSOVER_TYPE
public static final int DEFAULT_MUTATION_TYPE
public static final float DEFAULT_ELITISM_PERCENT
public static final float DEFAULT_PRESERVE_PERCENT
public static final float DEFAULT_MUTATION_PERCENT
public float MUTATION_PERCENT
public static final int DEFAULT_MUTATION_NUMBER
public static final java.lang.String TYPE_SGA
public GeneticAlgorithm()
public GeneticAlgorithm(int popSize)
public GeneticAlgorithm(java.lang.String name,
int popSize)
private void initialize(Population population)
public void initialize(Seed targetSeed, Seed[] seed)
Algorithminitialize in class Algorithmpublic void initialize(AlgHelper fh, Seed[] seed)
Algorithminitialize in class Algorithmpublic Organism getBestOrganism()
AlgorithmgetBestOrganism in class Algorithmpublic Seed getSolnSeed()
AlgorithmgetSolnSeed in class Algorithmpublic Population getPopulation()
public int getGenSinceImprovement()
public int getIterationCount()
public void setGenSinceImprovement(int newVal)
public void setAlgSubtype(java.lang.String subtype)
subtype - public java.lang.String getName()
public void setRNGSeed(int rngSeed)
public void setRNGSeed(long rngSeed)
public java.util.Random getRNG()
public int getSize()
public Seed getPopulationSeed(int seedIndex)
public void setPopulationSize(int popSize)
popSize - public int getNumBestSolutionsSaved()
public void setNumBestSolutionsSaved(int numBestSolutionsSaved)
public ElitismHelper getElitism()
public void setElitismStrategy(int elitismStrategy)
elitismStrategy - public void setElitismStrategy(ElitismHelper elitism)
elitism - public PreserveHelper getPreserver()
public void setPreservationStrategy(int preserveStrategy)
preserveStrategy - public void setPreserveStrategy(PreserveHelper preserver)
preserver - public SelectionHelper getSelector()
public void setSelectionStrategy(int selectionStrategy)
selectionStrategy - public void setSelectionStrategy(SelectionHelper selector)
selector - public float getPreservePct()
public void setPreservePct(float preservePct)
preservePct - public CrossoverHelper getCrossover()
public void setCrossoverStrategy(int crossoverStrategy)
crossoverStrategy - public void setCrossoverStrategy(CrossoverHelper crossover)
crossover - public Mutation getMutator()
public void setMutationStrategy(int mutationStrategy)
mutationStrategy - public void setMutationStrategy(Mutation mutator)
mutator - public int getElitismNumberSelected()
public int getPreservationNumberSelected()
public void setBGASearchSpace(int segment,
FloatProfile prof)
segment - prof - public void setRVGASearchSpace(int segment,
FloatProfile prof,
float step)
segment - prof - step - public float getAF_MIN(int type,
int seg,
int per)
public float getAF_MAX(int type,
int seg,
int per)
public int getAF_RANGE(int type,
int seg,
int per)
public float getAF_STEP(int type,
int seg,
int per)
public int getBinStringLength()
public void setBinStringLength(int binStringLength)
public java.lang.String convertToBinString(float newAF)
public java.lang.String getBinString(int intToConvert)
public static java.lang.String getBinString(int intToConvert,
int numDigits)