Documentation
¶
Index ¶
- func AllDistance(aSubs []int, searchDomainMatrix *mat64.Dense) (allDistMatrix *mat64.Dense)
- func AllMinDistance(aSubs, bSubs []int, searchDomainMatrix *mat64.Dense) (allMinDistMatrix *mat64.Dense)
- func BandMask(bandValue float64, bandMatrix *mat64.Dense) (binaryBandMat *mat64.Dense)
- func Bresenham(aSubs, bSubs []int) (lineSubs [][]int)
- func ChromosomeCrossover(chrom1Ind, chrom2Ind []int, chrom1Subs, chrom2Subs [][]int) (crossoverChrom [][]int)
- func ChromosomeIntersection(subs1, subs2 [][]int) (subs1Indices, subs2Indices []int)
- func ChromosomeToString(inputChromosome *Chromosome) (outputRawString [][]string)
- func CsvToSubs(inputFilepath string) (outputSubs []int)
- func DigitCount(input int) (digits int)
- func DirectedWalk(sourceSubs, destinationSubs []int, searchDomain *Domain, ...) (subs [][]int)
- func Distance(aSubs, bSubs []int) (dist float64)
- func DistanceBands(bandCount int, distanceMatrix *mat64.Dense) (bandMatrix *mat64.Dense)
- func EliteSetToCsv(inputEliteSet []*Chromosome, outputFilepath string)
- func FindSubs(inputValue float64, inputMatrix *mat64.Dense) (foundSubs [][]int)
- func FixMultiVariateNormalRandom(rndsmp *mat64.Dense) (fixsmp *mat64.Dense)
- func MinDistance(pSubs, aSubs, bSubs []int) (minDist float64)
- func MultiPartDirectedWalk(nodeSubs [][]int, searchDomain *Domain, searchParameters *Parameters) (subs [][]int)
- func MultiVariateNormalRandom(mu *mat64.Dense, sigma *mat64.SymDense) (rndsmp *mat64.Dense)
- func MutationLoci(inputChromosome *Chromosome) (previousLocus, mutationLocus, nextLocus []int, mutationIndex int)
- func MutationSubDomain(previousLocus, mutationLocus, nextLocus []int, inputDomain *mat64.Dense) (outputSubDomain *mat64.Dense)
- func MutationWalk(sourceSubs, destinationSubs []int, searchDomain *Domain, ...) (subs [][]int, tabuTest bool)
- func NeighborhoodSubs(aSubs []int) (neighSubs [][]int)
- func NewMu(curSubs, dstSubs []int) (mu *mat64.Dense)
- func NewNodeSubs(searchDomain *Domain, searchParameters *Parameters) (nodeSubs [][]int)
- func NewRandom(mu *mat64.Dense, sigma *mat64.SymDense) (newRand []int)
- func NewSigma(iterations int, randomness, distance float64) (sigma *mat64.SymDense)
- func NewSubs(curSubs, destinationSubs []int, curDist float64, searchParameters *Parameters, ...) (subs []int)
- func NonZeroSubs(inputMatrix *mat64.Dense) (nonZeroSubs [][]int)
- func Orientation(aSubs, bSubs []int) (orientationVector []int)
- func OrientationMask(aSubs, bSubs []int, searchDomainMatrix *mat64.Dense) (orientationMask *mat64.Dense)
- func PopulationMutation(inputChromosomes chan *Chromosome, inputParameters *Parameters, ...) (outputChromosomes chan *Chromosome)
- func PopulationSelection(inputPopulation *Population, inputParameters *Parameters) (selection chan *Chromosome)
- func RuntimeLogToCsv(inputEvolution *Evolution, inputRuntime time.Duration, outputFilepath string)
- func SelectionCrossover(inputSelection chan *Chromosome, inputParameters *Parameters, ...) (crossover chan *Chromosome)
- func TranslateWalkSubs(sourceSubs []int, inputWalkSubs [][]int) (outputWalkSubs [][]int)
- func ValidateMutationSubDomain(subSource, subDestin []int, subMat *mat64.Dense) bool
- func ValidateTabu(currentSubs []int, tabuMatrix *mat64.Dense) bool
- func ViewBasis(basisSolution *Basis)
- func ViewChromosome(searchDomain *Domain, searchParameters *Parameters, ...)
- func ViewDomain(searchDomain *Domain)
- func ViewPopulation(searchDomain *Domain, searchParameters *Parameters, ...)
- type Basis
- type Chromosome
- func ChromosomeFitness(inputChromosome *Chromosome, inputObjectives *MultiObjective) (outputChromosome *Chromosome)
- func ChromosomeMultiMutation(inputChromosome *Chromosome, inputDomain *Domain, inputParameters *Parameters, ...) (outputChromosome *Chromosome)
- func ChromosomeMutation(inputChromosome *Chromosome, inputDomain *Domain, inputParameters *Parameters, ...) (outputChromosome *Chromosome)
- func ChromosomeSelection(chrom1, chrom2 *Chromosome, selectionProb float64) (selectedChrom *Chromosome)
- func NewChromosome(searchDomain *Domain, searchParameters *Parameters, ...) *Chromosome
- func NewEliteFraction(inputFraction float64, inputPopulation *Population) (outputChromosomes []*Chromosome)
- func NewEliteSet(inputCount int, inputPopulation *Population, inputParameters *Parameters) (outputChromosomes []*Chromosome)
- func NewEmptyChromosome(searchDomain *Domain, searchObjectives *MultiObjective) *Chromosome
- type Domain
- func CsvToDomain(inputFilepath string) (outputDomain *Domain)
- func NewDomain(domainMatrix *mat64.Dense) *Domain
- func NewSampleDomain(rows, cols int) *Domain
- func NewSampleMutationDomain() *Domain
- func SubDomain(sourceLocus, destinationLocus []int, inputDomain *mat64.Dense) (subDomain *Domain, subSourceLocus, subDestinationLocus []int)
- type Evolution
- type MultiObjective
- type Mutator
- type Objective
- type Parameters
- type Population
- func NewEmptyPopulation(identifier int, searchObjectives *MultiObjective) *Population
- func NewPopulation(identifier int, searchDomain *Domain, searchParameters *Parameters, ...) *Population
- func PopulationEvolution(inputPopulation *Population, inputDomain *Domain, inputParameters *Parameters, ...) (outputPopulation *Population)
- func PopulationFitness(inputPopulation *Population, inputParameters *Parameters, ...) (outputPopulation *Population)
- type Walker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllDistance ¶
alldistance computes the distance from each location with the input
search domain and a given point defined by an input pair of row column subscripts
func AllMinDistance ¶
func AllMinDistance(aSubs, bSubs []int, searchDomainMatrix *mat64.Dense) (allMinDistMatrix *mat64.Dense)
allmindistance computes the distance from each location within the
input search domain and to the nearest subscript located along the line formed by the two input subscripts
func BandMask ¶
bandmask selects the elements in a distance band matrix
corresponding to a specified input band identification number and outputs a binary matrix of the same dimensions as the distance band matrix with the values at those locations encoded as ones and all other locations encoded as zeros
func Bresenham ¶
bresenham generates the list of subscript indices corresponding to the
euclidean shortest paths connecting two subscript pairs in discrete space
func ChromosomeCrossover ¶
func ChromosomeCrossover(chrom1Ind, chrom2Ind []int, chrom1Subs, chrom2Subs [][]int) (crossoverChrom [][]int)
crossover operator performs the single point crossover
operation for two input chromosomes that have previously been selected from a source population
func ChromosomeIntersection ¶
intersection determines whether or not the subscripts
associated with two input chromosomes share any in values in common and reports their relative indices
func ChromosomeToString ¶
func ChromosomeToString(inputChromosome *Chromosome) (outputRawString [][]string)
function to write the values from an input
chromosome structure to an output csv file
func CsvToSubs ¶
function to write an input comma separated value
file's contents to an output domain structure
func DigitCount ¶
function to count the number of digits in an input integer as
its base ten logarithm
func DirectedWalk ¶
func DirectedWalk(sourceSubs, destinationSubs []int, searchDomain *Domain, searchParameters *Parameters, basisSolution *Basis) (subs [][]int)
directedwalk generates a new directed walk connecting a source subscript to a
destination subscript within the context of an input search domain
func DistanceBands ¶
distancebands recodes a distance matrix computed from a single
source location to ordinal set of bands of increasing distance
func EliteSetToCsv ¶
func EliteSetToCsv(inputEliteSet []*Chromosome, outputFilepath string)
function to write the values from an input elite set
to an output csv file
func FindSubs ¶
findsubs returns a 2-D slice containing the row column indices
of all of the elements contained wihtin a given input matrix that are equal in value to some provided input value
func FixMultiVariateNormalRandom ¶
fixmultivariatenormalrandom converts an input vector of bivariate normally
distributed random numbers into a version where the values have been fixed to a [-1, 0 ,1] range
func MinDistance ¶
compute the minimum distance between a given input point and
the subscripts comprised of a line segement joining two other input points
func MultiPartDirectedWalk ¶
func MultiPartDirectedWalk(nodeSubs [][]int, searchDomain *Domain, searchParameters *Parameters) (subs [][]int)
multipartdirectedwalk generates a new multipart directed walk from a given set
of input problem parameters
func MultiVariateNormalRandom ¶
multivariatenormalrandom generates pairs of bivariate normally distributed
random numbers given an input mean vector and covariance matrix
func MutationLoci ¶
func MutationLoci(inputChromosome *Chromosome) (previousLocus, mutationLocus, nextLocus []int, mutationIndex int)
mutationLocus to randomly select a mutation locus and return the adjacent
loci along the length of the chromosome
func MutationSubDomain ¶
func MutationSubDomain(previousLocus, mutationLocus, nextLocus []int, inputDomain *mat64.Dense) (outputSubDomain *mat64.Dense)
mutation sub domain returns the subdomain to be used for the mutation
specific directed walk procedure
func MutationWalk ¶
func MutationWalk(sourceSubs, destinationSubs []int, searchDomain *Domain, searchParameters *Parameters, basisSolution *Basis) (subs [][]int, tabuTest bool)
mutationwalk generates a new directed walk connecting a source subscript
to a destination subscript within the context of an input mutation search domain
func NeighborhoodSubs ¶
function to return the subscript indices of the cells corresponding to the
queens neighborhood for a given subscript pair
func NewMu ¶
newmu generates a matrix representation of mu that reflects the
spatial orentiation between the input current subscript and the destination subscript
func NewNodeSubs ¶
func NewNodeSubs(searchDomain *Domain, searchParameters *Parameters) (nodeSubs [][]int)
newnodesubs generates an poutput slice of new intermediate destination nodes
that are progressively further, in terms of euclidean distance, from a given input source location and are orientation towards a given destination location
func NewRandom ¶
newrandom repeatedly generates a new random sample from mvrnd and then fixes
it using fixrandom until the sample is comprised of a non [0, 0] case
func NewSigma ¶
newsigma generates a matrix representation of sigma that reflects the
number of iterations in the sampling process as well as the distance from the basis euclidean solution
func NewSubs ¶
func NewSubs(curSubs, destinationSubs []int, curDist float64, searchParameters *Parameters, searchDomain *Domain) (subs []int)
newsubs generates a feasible new subscript value set within the
input search domain
func NonZeroSubs ¶
nonzerosubs returns a 2-D slice containing the row column indices
of all nonzero elements contained wihtin a given input matrix
func Orientation ¶
orientation accepts as inputs a pair of point subscripts
and returns a binary vector indicating the relative orientation of the first point to the second in binary terms
func OrientationMask ¶
func OrientationMask(aSubs, bSubs []int, searchDomainMatrix *mat64.Dense) (orientationMask *mat64.Dense)
orientation mask returns a binary encoded matrix for
a given point where all points orientated towards a given second point are encoded as 1 and all points orientated away from the given second point as 0
func PopulationMutation ¶
func PopulationMutation(inputChromosomes chan *Chromosome, inputParameters *Parameters, inputObjectives *MultiObjective, inputDomain *Domain) (outputChromosomes chan *Chromosome)
function to generate mutations within a specified fraction of an input
population with those chromosomes being selected at random
func PopulationSelection ¶
func PopulationSelection(inputPopulation *Population, inputParameters *Parameters) (selection chan *Chromosome)
population selection operator selects half of the input
population for reproduction based upon comparative fitness and some randomized input selection fraction
func RuntimeLogToCsv ¶
function to write the runtime parameters from an evolution
to an output csv file
func SelectionCrossover ¶
func SelectionCrossover(inputSelection chan *Chromosome, inputParameters *Parameters, inputObjectives *MultiObjective, inputDomain *Domain) (crossover chan *Chromosome)
selection crossover operator performs a single part
crossover on each of the individuals provided in an input selection channel of chromosomes
func TranslateWalkSubs ¶
function to translate the subscript index values for a given slice of input
loci relative to a given offset vector
func ValidateMutationSubDomain ¶
function to validate an input sub domain for use in generating
a chromosomal mutation via the random walk procedure
func ValidateTabu ¶
function validate the tabu neighborhood of an input pair of
row column subscripts
func ViewBasis ¶
func ViewBasis(basisSolution *Basis)
function to print the properties of a basis solution to the command line
func ViewChromosome ¶
func ViewChromosome(searchDomain *Domain, searchParameters *Parameters, inputChromosome *Chromosome)
function to print the properties of a chromosome to the command line
func ViewDomain ¶
func ViewDomain(searchDomain *Domain)
function to print the properties of a search domain to the command line
func ViewPopulation ¶
func ViewPopulation(searchDomain *Domain, searchParameters *Parameters, inputPopulation *Population)
functions to print the frequency of chromosomes in a search domain to the command line
Types ¶
type Basis ¶
type Basis struct {
Matrix *mat64.Dense // basis matrix values
Subs [][]int // basis row column subscripts
MaxLen int // maximum length
}
a basis solution is comprised of the subscript indices forming
the euclidean shortest path connecting the source to the dest
type Chromosome ¶
type Chromosome struct {
Id uuid.UUID // globally unique chromosome identification number
Subs [][]int // chromosome row column subscripts
Fitness [][]float64 // objective function values
TotalFitness []float64 // total fitness values for each objective
AggregateFitness float64 // total aggregate fitness value for all objectives
}
chromosomess are comprised of genes which are distinct row column
indices to some spatially reference search domain
func ChromosomeFitness ¶
func ChromosomeFitness(inputChromosome *Chromosome, inputObjectives *MultiObjective) (outputChromosome *Chromosome)
fitness function to generate the total fitness and chromosome
fitness values for a given input chromosome
func ChromosomeMultiMutation ¶
func ChromosomeMultiMutation(inputChromosome *Chromosome, inputDomain *Domain, inputParameters *Parameters, inputObjectives *MultiObjective) (outputChromosome *Chromosome)
function to generate multiple mutations on multiple separate loci on the same
input chromosome
func ChromosomeMutation ¶
func ChromosomeMutation(inputChromosome *Chromosome, inputDomain *Domain, inputParameters *Parameters, inputObjectives *MultiObjective) (outputChromosome *Chromosome)
function to generate a mutation within a given chromosome at a specified
number of mutation loci
func ChromosomeSelection ¶
func ChromosomeSelection(chrom1, chrom2 *Chromosome, selectionProb float64) (selectedChrom *Chromosome)
selection operator selects between two chromosomes with a
probability of the most fit chromosome being selected determined by the input selection probability ratio
func NewChromosome ¶
func NewChromosome(searchDomain *Domain, searchParameters *Parameters, searchObjectives *MultiObjective) *Chromosome
new chromosome initialization function
func NewEliteFraction ¶
func NewEliteFraction(inputFraction float64, inputPopulation *Population) (outputChromosomes []*Chromosome)
function to return copies of a user specified fraction of
the individual chromosomes within a population ranked in terms of individual aggregate fitness
func NewEliteSet ¶
func NewEliteSet(inputCount int, inputPopulation *Population, inputParameters *Parameters) (outputChromosomes []*Chromosome)
function to return copies of a user specified number of
unique individual chromosomes from within a population with each chromosome being ranked in terms of its individual aggregate fitness
func NewEmptyChromosome ¶
func NewEmptyChromosome(searchDomain *Domain, searchObjectives *MultiObjective) *Chromosome
new empty chromosome initialization function
type Domain ¶
type Domain struct {
Rows int // row count
Cols int // column count
Matrix *mat64.Dense // domain matrix values
BndCnt int // distance band count
}
domains are comprised of boolean arrays which indicate the
feasible locations for the search algorithm
func CsvToDomain ¶
function to write an input comma separated value
file's contents to an output domain structure
func NewSampleDomain ¶
new sample domain initialization function
func NewSampleMutationDomain ¶
func NewSampleMutationDomain() *Domain
new sample mutation domain initialization function
type Evolution ¶
type Evolution struct {
Populations chan *Population // population channel
FitnessGradient []float64 // fitness gradient values
}
evolutions are comprised of a stochastic number of populations.
this number is determined by the convergence rate of the algorithm
func NewEmptyEvolution ¶
func NewEmptyEvolution(searchParameters *Parameters) *Evolution
new empty evolution initialization function
func NewEvolution ¶
func NewEvolution(searchParameters *Parameters, searchDomain *Domain, searchObjectives *MultiObjective) *Evolution
new evolution initialization function
type MultiObjective ¶
type MultiObjective struct {
ObjectiveCount int // objective count
Objectives []*Objective // individual objective objects
}
multiObjective objects are comprised of a channel of individual
independent objectives that are used for the evaluation of chromosome and population level fitness values
func CsvToMultiObjective ¶
func CsvToMultiObjective(inputFilepaths ...string) (outputMultiObjective *MultiObjective)
function to write a set of input comma separated value
files' contents to an output multiobjective structure
func NewSampleObjectives ¶
func NewSampleObjectives(rows, cols, objectiveCount int) *MultiObjective
new sample objective initialization function
type Mutator ¶
type Mutator struct {
SearchDomain *Domain // local search domain copy
SearchParameters *Parameters // local search parameters copy
SearchObjectives *MultiObjective // local search objectives copy
}
mutators are used to generate point location mutations in
parallel for a subset of chromosomes within a population
func NewMutator ¶
func NewMutator(searchDomain *Domain, searchParameters *Parameters, searchObjectives *MultiObjective) Mutator
new mutator initialization function
type Objective ¶
type Objective struct {
Id int // objective identification number
Matrix *mat64.Dense // objective matrix values
}
objectives are comprised of matrices which use location
indices to key to floating point fitness values within the search domain
func CsvToObjective ¶
function to write an input comma separated value
file's contents to an output objective structure
type Parameters ¶
type Parameters struct {
SrcSubs []int // source subscripts
DstSubs []int // destination subscripts
RndCoef float64 // randomness coefficient
PopSize int // population size
SelFrac float64 // selection fraction
SelProb float64 // selection probability
MutaCnt int // muation count
MutaFrc float64 // muation fraction
EvoSize int // evolution size
ConSize int // concurrency limit
}
parameters are comprised of fixed input avlues that are
unique to the problem specification that are referenced by the algorithm at various stage of the solution process
func NewParameters ¶
func NewParameters(sourceSubscripts, destinationSubscripts []int, populationSize, evolutionSize int, randomnessCoefficient float64) *Parameters
new problem parameters function
func NewSampleParameters ¶
func NewSampleParameters(searchDomain *Domain) *Parameters
new sample parameters initialization function
type Population ¶
type Population struct {
Id int // population ordinal identification number
Chromosomes chan *Chromosome // chromosome channel
MeanFitness []float64 // chromosome mean fitnesses channel
AggregateMeanFitness float64 // chromosome aggregate fitness channel
}
populations are comprised of a fixed number of chromosomes.
this number corresponds to the populationSize.
func NewEmptyPopulation ¶
func NewEmptyPopulation(identifier int, searchObjectives *MultiObjective) *Population
new empty population initialization function
func NewPopulation ¶
func NewPopulation(identifier int, searchDomain *Domain, searchParameters *Parameters, searchObjectives *MultiObjective) *Population
new population initialization function
func PopulationEvolution ¶
func PopulationEvolution(inputPopulation *Population, inputDomain *Domain, inputParameters *Parameters, inputObjectives *MultiObjective) (outputPopulation *Population)
population evolution operator generates a new population
from an input population using the selection and crossover operators
func PopulationFitness ¶
func PopulationFitness(inputPopulation *Population, inputParameters *Parameters, inputObjectives *MultiObjective) (outputPopulation *Population)
fitness function generate the mean fitness values for all of the chromosomes
in a given population
type Walker ¶
type Walker struct {
Id uuid.UUID // globally unique walker identification number
SearchDomain *Domain // local search domain copy
SearchParameters *Parameters // local search parameters copy
SearchObjectives *MultiObjective // local search objectives copy
}
walkers are used in the concurrency model which facilitates
the parallel problem initializations
func NewWalker ¶
func NewWalker(searchDomain *Domain, searchParameters *Parameters, searchObjectives *MultiObjective) Walker
new walker initialization function
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
problems
|
|
|
Fresno
command
|
|
|
Oxnard
command
|
|
|
SanBernadino
command
|
|
|
SanBernadinoValidation
command
|
|
|
SanDiego
command
|
|
|
SantaBarbara
command
|