Documentation
¶
Index ¶
- Constants
- Variables
- func CalculateFitnessOpt(genes []*Gene)
- func GetDataNum() int
- func GetEffectGene(s []byte) []byte
- func GetEffectGenes(gene Gene) (k [][]byte)
- func GetInfixExpression(s []byte) []byte
- func GetInfixExpressions(gene Gene) (k [][]byte)
- func GetMaxFactorNum() int
- func GetOperationFactorNum(operationName byte) int
- func GetVarSetNum() int
- func InitTestData()
- func PrintGreat(g *Gene)
- func PrintMostEasy(genes []*Gene)
- func PrintSelf(genes []*Gene)
- func PrintSelfEasy(genes []*Gene)
- type Gene
- func Change(gene *Gene, genes []*Gene) *Gene
- func CreateGenes() []*Gene
- func Elite(genes []*Gene, num int, sons []*Gene) []*Gene
- func EliteNone(genes []*Gene, num int, sons []*Gene) []*Gene
- func Evolution(dads []*Gene) []*Gene
- func Select(genes []*Gene, sons []*Gene) []*Gene
- func Turn(genes []*Gene, num int, sons []*Gene) []*Gene
- type Operation
- type TestData
Constants ¶
View Source
const ( Open = true Close = false Detailed = 0 Simple = 1 Simplest = 2 )
Variables ¶
View Source
var Chart = Close
开启图表
View Source
var ChartInterval = 0
图表记录跨度 0为每次变异记录
View Source
var ChartPort = 8081
图表端口
View Source
var CsvFileName = "sunspots.csv"
运行参数配置
CSV文件名称(请放置于根目录下)
View Source
var DcMutationRate = 0.0385
直接变异率 0.144 0.0385
View Source
var DynamicDcMutation = Open
高阶GEP参数配置
自适应变异率开关
View Source
var DynamicDcMutationRate = 1.0
自适应变异率基数
View Source
var EliteNum = 0
精英策略个数
View Source
var FunSet = []byte{'+', '-', '*', '/'}
函数集
View Source
var GeneLength = HeadLength + TailLength
基因长度
View Source
var GeneTranspositionRate = 0.1
转座概率
View Source
var HeadLength = 7
GEP参数配置
头部长度 7 6 简单/a3
View Source
var ISElementsLength = 2
插入转座元素长度
View Source
var ISTranspositionRate = 0.1
插入转座率
View Source
var LinkFun = byte('+')
连接函数
View Source
var MaxFactorNum = GetMaxFactorNum()
最大操作数(参数个数)
View Source
var MaxFitness float64 = 0
View Source
var MaxGenerations = 5000
最高运行代数 0 - 不限制
View Source
var NonEliteNum = 4
不变异精英策略个数
View Source
var NumOfGenes = 3
染色体含有基因数 3 4
View Source
var OnePointRecombinationRate = 0.3
单点重组率 0.4 0.3
View Source
var PopulationsSize = 100
基因产生个数 20 30
View Source
var Precision float64 = 800
选择精度
View Source
var RISElementsLength = 2
根转座元素长度
View Source
var RISTranspositionRate = 0.1
根转座率
View Source
var RecombinationRate = 0.1
重组率
View Source
var ResultRang = 0.0
选择结果
View Source
var SelectRang float64 = 1000
选择范围
View Source
var TailLength = HeadLength*(MaxFactorNum-1) + 1
基因尾部长度
View Source
var TermSet = TermSetAll
终点集
View Source
var TermSetAll = []byte{
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'}
View Source
var TurnNum = PopulationsSize - EliteNum - NonEliteNum
转盘赌个数
View Source
var TwoPointRecombinationRate = 0.3
双点重组率 0.2 0.3
View Source
var ViewStyle = Simplest
控制台输出方式 Detailed - 详细,Simple - 简略,Simplest - 最简略
View Source
var Wg sync.WaitGroup
Functions ¶
func GetDataNum ¶
func GetDataNum() int
func GetVarSetNum ¶
func GetVarSetNum() int
func InitTestData ¶
func InitTestData()
func PrintGreat ¶
func PrintGreat(g *Gene)
Types ¶
Click to show internal directories.
Click to hide internal directories.