| 1 |
package |
|---|
| 2 |
{ |
|---|
| 3 |
import flash.display.Sprite; |
|---|
| 4 |
import flash.geom.Point; |
|---|
| 5 |
import flash.utils.getTimer; |
|---|
| 6 |
|
|---|
| 7 |
import jp.dip.hael.gameai.ga.GA; |
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
/** |
|---|
| 11 |
* @private |
|---|
| 12 |
*/ |
|---|
| 13 |
public class GATest extends Sprite |
|---|
| 14 |
{ |
|---|
| 15 |
public function GATest() |
|---|
| 16 |
{ |
|---|
| 17 |
var ga:GA = new GA(); |
|---|
| 18 |
for(var i:int = 0; i < 10;i++){ |
|---|
| 19 |
ga.addEntitiy(new GATestEntity()); |
|---|
| 20 |
} |
|---|
| 21 |
for each(var entity:GATestEntity in ga.entities){ |
|---|
| 22 |
trace(entity.evaluate()); |
|---|
| 23 |
} |
|---|
| 24 |
for(i = 0; i < 2000; i++){ |
|---|
| 25 |
ga.heredity(3); |
|---|
| 26 |
} |
|---|
| 27 |
trace("---"); |
|---|
| 28 |
for each(entity in ga.entities){ |
|---|
| 29 |
trace(entity.evaluate()); |
|---|
| 30 |
} |
|---|
| 31 |
|
|---|
| 32 |
} |
|---|
| 33 |
|
|---|
| 34 |
} |
|---|
| 35 |
} |
|---|