MindMap Gallery Basics of genetic algorithm and some common functions
Basics of genetic algorithm and some common functions
Edited at 2018-12-24 13:29:44Avatar 3 centers on the Sully family, showcasing the internal rift caused by the sacrifice of their eldest son, and their alliance with other tribes on Pandora against the external conflict of the Ashbringers, who adhere to the philosophy of fire and are allied with humans. It explores the grand themes of family, faith, and survival.
This article discusses the Easter eggs and homages in Zootopia 2 that you may have discovered. The main content includes: character and archetype Easter eggs, cinematic universe crossover Easter eggs, animal ecology and behavior references, symbol and metaphor Easter eggs, social satire and brand allusions, and emotional storylines and sequel foreshadowing.
[Zootopia Character Relationship Chart] The idealistic rabbit police officer Judy and the cynical fox conman Nick form a charmingly contrasting duo, rising from street hustlers to become Zootopia police officers!
Avatar 3 centers on the Sully family, showcasing the internal rift caused by the sacrifice of their eldest son, and their alliance with other tribes on Pandora against the external conflict of the Ashbringers, who adhere to the philosophy of fire and are allied with humans. It explores the grand themes of family, faith, and survival.
This article discusses the Easter eggs and homages in Zootopia 2 that you may have discovered. The main content includes: character and archetype Easter eggs, cinematic universe crossover Easter eggs, animal ecology and behavior references, symbol and metaphor Easter eggs, social satire and brand allusions, and emotional storylines and sequel foreshadowing.
[Zootopia Character Relationship Chart] The idealistic rabbit police officer Judy and the cynical fox conman Nick form a charmingly contrasting duo, rising from street hustlers to become Zootopia police officers!
genetic algorithm
basic genetic algorithm
chromosomal coding
Binary (commonly used)
integer
real value
fitness function
A function written according to the evolutionary goal to calculate the individual fitness value. The fitness value of each individual is calculated through the fitness function and provided to the selection operator for selection.
fitness assessment
decoding
Evaluation objective function
to fitness
Maximum problem: fitness is the objective function
Minimum value problem: converted to maximum value problem
genetic manipulation
choose
Great fitness, high probability of being selected
Use the proportional selection operator
cross
Use single point crossover operator
two individuals
Randomly generate an intersection location
exchange part of genetic code
Crossover probability: 0.4~0.99
Mutations
basic bit mutation operator
uniform mutation operator
Avoid premature convergence of problems
binary gene
0 becomes 1, 1 becomes 0
Mutation probability Pm:0.0001~0.1
Genetic algorithm commonly used functions
Create population function-crtbp
[Chrom,Lind,BaseV]=crtbp(Nind,Lind)
Create a random binary matrix of size Nind*Lind
Nind: number of individuals in the population
Lind: individual length
return:
Chrom: population encoding
Individual length: Lind
BaveV: basic character vector of chromosomal loci
[Chrom,Lind,BaseV]=crtbp(Nind,Base)
The base number of each individual code is determined by Base
The number of columns in Base is the individual length
[Chrom,Lind,BaseV]=crtbp(Nind,Lind,Base)
Lind can be omitted
eg:
[Chrom,Lind,BaseV]=crtbp(5,10)
[Chrom,Lind,BaseV]=crtbp(5,[2,2,2,2,2,2,2,2,2,2])
[Chrom,Lind,BaseV]=crtbp(5,10,[2,2,2,,2,2,2,2,2,2,2])
Fitness calculation function——ranking
FitnV=ranking(objv)
Sort the individuals according to their target value ObjV (column vector) from small to large, and return the column vector of individual fitness value FitV?
FitnV=ranking(objV,RFun)
There are three cases of RFun in this format:
is a scalar in the interval [1,2], then linear sorting is used. This scalar specifies the selected pressure difference.
is a vector with two parameters
RFun(2): Specify the sorting method
0: Linear sorting
1: Non-linear sorting
RFun(1):
Linear sorting:
The selected pressure difference RFun(1) specified by the scalar must be in the interval [1,2]
Nonlinear sorting: RFun(1) must be in the interval [1, length(ObjV)-2]
NAN: RFun(1) assumes 2
RFun is a vector of length(ObjV), then it contains the calculation of the fitness value of each row
FitnV=ranking(ObjV,RFun,SUBPOP)
ObjV: Same as above
RFun: Same as above
SUBPOP: Specifies the number of subpopulations in ObjV
Omitted or NAN, SUBPOP=1
Note: All subpopulations in ObjV must be the same size
eg:
Use linear sorting and a pressure differential of 2