please refer to
thank you!
Normal fractal algorithm is too strictly self-similar in modeling nature scenery, even a random issue is corporated, the process of genetic growth is still not simulated appropriately.
strictly sel-similarity normal fractal tree
In this paper, I adopted the concept of genetic operations into the traditional fractal-tree generating algorithms, design suitable data structure to encode the characteristic of the branch; GA operators such as cross-over、mutation、selection are operated on the code and the characteristic of the child branch is generated from the genetic operation of the parent branch; thus they are similar but not identical. The algorithm can generate an image that is self-similar but not strictly self-similar; the process of genetic growth can be simulated more appropriately and in more details.
The next two pictures are the first version. They remove the strict self similarity, but there are still a lot to improve...
GA fractal tree 1
GA fractal tree 2
The key to improve the reality is too increase the control on parameters.
branch angel control
branch number control
branch length control
branch position control
data structure
struct info{
CPoint p; //branch start point
float plen; //parent branch length
int pangl; //parent branch angle
char h; //1: right branch; 2: left branch
}
algorithm flow
do{
crossover
mutation
do{
select
if (tree.cur.glen ) {//if 0,end evolution on this branch
……
if (tree.depth ){//depth=0, no need to generate new branch, it is alreayd the last generation
next_generation += number of branch
}
draw branch
}
cur_generation--;
}while ( this->tree.cur_generation )
this->tree.depth--;
this->tree.cur_generation = this->tree.next_generation;
this->tree.next_generation = 0;
}while ( this->tree.depth >= 0 )
GA operator design
crossover operator is essencially bit operations in this algorithm, I adopt the single point operator, its mutation race is minimul in all types of crossover operator;
As similarity the first priority while disturben is less important, so mutation rate is configured to 0.4, a relatively small number.
Besides, in order to control the strength of operation, operators are performed on low bits. The whole value of the encoded branch do not change too much.
Random number handle
Random() generate evenly distributed numbers, in this algorithm, I need normal distribution. So the random generated number sequence need to be handled first befor using in GA operations.
|
文件: |
Research on 2D Fractal Recursive Algorithm Syncretized Genetic Operation.pdf |
大小: |
435KB |
下载: |
下载 | |
阅读(364) | 评论(0) | 转发(0) |