C-Evolutionary-Algorithm
所属分类:人工智能/神经网络/深度学习
开发工具:C
文件大小:0KB
下载次数:0
上传日期:2024-02-02 15:55:12
上 传 者:
sh-1993
说明: CEA:EA内置C-所有一个文件
(CEA: EA Built in C - all one file)
文件列表:
.idea/
CMakeLists.txt
main.c
# CEA: Evolutionary Algorithm Implemented in C [Demo]
A simple EA implemented in the C programming language.
The task in this example initalises a population of individuals each with five genes that can be A-Z.
We start by initialising a population, iterating on it a preset number of times where the best two are used to breed - in this case two point crossover. Then we add random mutation on each gene with a 0.2 prob. The childs fitness is calculated and added to the population. After the iteration loop the population is printed to screen.
The example EA is optimising for the character B and so our fitness is just count of B's.
Things that could be improved:
- Better selection (and put in a method)
- Implementation of other crossovers
- Noise based random mutation (broadly seen as better performing)
- Many many more things
---
This code was just made for fun and to practice C.
> Time log: 02:39:00 elapsed.
近期下载者:
相关文件:
收藏者: