블로그 이미지
Leeway is... the freedom that someone has to take the action they want to or to change their plans.
maetel

Notice

Recent Post

Recent Comment

Recent Trackback

Archive

calendar

1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
  • total
  • today
  • yesterday

Category

2008-05-01 나무 @504


1) random Tree 생성

함수 리스트
terminal (단말) 리스트

함수 리스트에서 {+, *, cos, ..., minus} random하게 선택하여 (uniform distribution) Tree의 root로 삼는다.
depth 만큼 Tree를 생성하고 나면, 단말 리스트에서 random하게 선택하여 Tree의 leaf로 삼는다


주어진 depth에 대해
(1) 상수일지 함수일지 선택
(2) 상수이면 leaf가 되는 것이고, 함수이면 다음 depth를 생성한다.

if (current.depth < maximum.depth)
{ 함수 선택 }


1. Class Tree를 만들고
2. Tree instance를 여러 개 만들어서 list로 만든다.
3. 주어진 depth에 대해 2로부터 random choice로 Tree 구조를 생성한다.
"Left를 먼저 채울지 Right를 먼저 채울지도 random으로 선택"


2) mutation과 combination

방법
1. mutation이 일어날 Tree를 random하게 (낮은 비율로) 선택한다.
2. 각 node를 방문하여 mutation의 여부를 결정한다.
3.




'@GSMC > 정문열: Generative Art' 카테고리의 다른 글

treemaps  (0) 2008.05.29
변수  (0) 2008.05.17
Class와 Object  (0) 2008.04.14
[이선애] study 1  (0) 2008.03.28
class 3/27  (0) 2008.03.27
posted by maetel