Documentation ¶
Index ¶
- Constants
- Variables
- func CalculateFitnessOpt(genes []*Gene)
- 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 GetPredictSampleResult(easyEquation [][]byte) []float64
- func GetPredictTestResult(easyEquation [][]byte) []float64
- func GetSampleDataNum() int
- func GetSampleResult() []float64
- func GetSampleResultAvg() float64
- func GetTestDataNum() int
- func GetTestResult() []float64
- func GetVarSetNum() int
- func InitSampleData()
- func PrintGreat(g *Gene)
- func PrintMostEasy(genes []*Gene)
- func PrintSelf(genes []*Gene)
- func PrintSelfEasy(genes []*Gene)
- type Data
- 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
Constants ¶
View Source
const ( Open = true Close = false Detailed = 0 Simple = 1 Simplest = 2 )
A R I M A : 差 分 整 合 移 动 自 回 归 时间序列预测: //1.改进的适应度函数<拟合程度参与适应度函数计算> //2.误差分析函数 //3.预测新的一组数据集 4.避免早熟收敛 I. 增大变异率 II. 增大种群数量 III.在进化一定阶段时引入新个体<种群年龄分层>
Variables ¶
View Source
var Chart = Close
开启遗传记录图表
View Source
var ChartInterval = 0
图表记录跨度 0为每次变异记录
View Source
var ChartPort = 8081
图表端口
View Source
var CsvSampleFileName = "sunspots_sample.csv"
运行参数配置
CSV样本集文件名称(请放置于根目录下) var CsvSampleFileName = "vegetables_sample.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 FitnessFunc = 0
适应度函数选择
View Source
var FunSet = []byte{'+', '-', '*', '/', '@'} //,'@','$','N','Q'
函数集
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 = 3
插入转座元素长度
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 = 8000
最高运行代数 0 - 不限制
View Source
var MoreFunc = Close
开启生成时函数符比例增多
View Source
var NonEliteNum = 2
不变异精英策略个数
View Source
var NumOfGenes = 4
染色体含有基因数 3 4
View Source
var OnePointRecombinationRate = 0.3
单点重组率 0.4 0.3
View Source
var PopulationsSize = 100
基因产生个数 20 30
View Source
var Precision float64 = 0
选择精度
View Source
var RISElementsLength = 3
根转座元素长度
View Source
var RISTranspositionRate = 0.1
根转座率
View Source
var RecombinationRate = 0.1
重组率
View Source
var ResultRang = 0.0
选择结果
View Source
var ResultSampleAvg = 0.0
样本结果平均数
View Source
var SelectRang float64 = 1000
选择范围
View Source
var TailLength = HeadLength*(MaxFactorNum-1) + 1
基因尾部长度
View Source
var TenCheck = Open
开启 10*10 交叉检验
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 GetPredictSampleResult ¶
func GetPredictTestResult ¶
func GetSampleDataNum ¶
func GetSampleDataNum() int
func GetSampleResult ¶
func GetSampleResult() []float64
func GetSampleResultAvg ¶
func GetSampleResultAvg() float64
func GetTestDataNum ¶
func GetTestDataNum() int
func GetTestResult ¶
func GetTestResult() []float64
func GetVarSetNum ¶
func GetVarSetNum() int
func InitSampleData ¶
func InitSampleData()
func PrintGreat ¶
func PrintGreat(g *Gene)
Types ¶
type Data ¶
func ReadSampleData ¶
func ReadSampleData() []Data
func ReadTestData ¶
func ReadTestData() []Data
Click to show internal directories.
Click to hide internal directories.