Done ABCD tester frame

pull/1/head
Yong Zhu 5 years ago
parent 85725462d7
commit fcb7c8aba9

@ -34,10 +34,15 @@ public class Env extends JPanel {
public static final int FROG_PER_EGG = 4; // 每个蛋可以孵出几个青蛙
public static final int SCREEN = 4; // 分几屏测完
public static final int SCREEN = 5; // 分几屏测完
public static final int FROG_PER_SCREEN = EGG_QTY * FROG_PER_EGG / SCREEN; // 每屏上显示几个青蛙,这个数值由上面三个参数计算得来
/** Frog's brain size 青蛙脑空间的大小 */
public static final int FROG_BRAIN_XSIZE = 30; // frog的脑在X方向长度
public static final int FROG_BRAIN_YSIZE = 20; // frog的脑在Y方向长度
public static final int FROG_BRAIN_ZSIZE = 20; // frog的脑在Z方向长度
/** SHOW first frog's brain structure */
public static boolean SHOW_FIRST_FROG_BRAIN = true; // 是否显示脑图在Env区的右侧
@ -57,11 +62,6 @@ public class Env extends JPanel {
public static final int STEPS_PER_ROUND = 3000;// 每轮测试步数,可调
public static int step;// 当前测试步数
/** Frog's x radius, brain volume = XSIZE * YSIZE * ZSIZE */
public static final int FROG_BRAIN_XSIZE = 50; // frog的脑在X方向长度
public static final int FROG_BRAIN_YSIZE = 25; // frog的脑在Y方向长度
public static final int FROG_BRAIN_ZSIZE = 15; // frog的脑在Z方向长度
public static final int FOOD_QTY = 100; // 食物数量, 可调
// 以下是程序内部变量,不要手工修改它们
@ -196,7 +196,7 @@ public class Env extends JPanel {
Frog firstFrog = frogs.get(screen * FROG_PER_SCREEN);
for (int j = 0; j < FROG_PER_SCREEN; j++) {
Frog f = frogs.get(screen * FROG_PER_SCREEN + j);
f.initOrgans(); // 初始化器官延迟到这一步,是因为脑细胞太占内存,而且测完后会清空
f.initFrog(); // 初始化器官延迟到这一步,是因为脑细胞太占内存,而且当前屏测完后会清空
}
for (step = 0; step < STEPS_PER_ROUND; step++) {
for (Object thing : things)// 调用食物、陷阱等物体的动作

@ -33,7 +33,6 @@ import com.github.drinkjava2.frog.objects.Material;
* @since 1.0
*/
public class Frog {
/** brain cells */
public Cube[][][] cubes;
@ -56,48 +55,51 @@ public class Frog {
}
public Frog(int x, int y, Egg egg) {
initCubes();
this.x = x; // x, y 是虑拟环境的坐标
this.y = y;
for (Organ org : egg.organs)
organs.add(org);
}
public void initCubes() {
cubes = new Cube[Env.FROG_BRAIN_XSIZE][Env.FROG_BRAIN_YSIZE][Env.FROG_BRAIN_ZSIZE];
for (int a = 0; a < Env.FROG_BRAIN_XSIZE; a++)
for (int b = 0; b < Env.FROG_BRAIN_YSIZE; b++)
for (int c = 0; c < Env.FROG_BRAIN_ZSIZE; c++)
cubes[a][b][c] = new Cube();
}
public void initOrgans() {// 调用每个器官的init方法通常用于脑细胞的播种
public void initFrog() {// 仅在测试之前调用这个方法初始化frog以节约内存测试完成后要清空cubes释放内存
try {
cubes = new Cube[Env.FROG_BRAIN_XSIZE][][]; // 为了节约内存先只初始化三维数组的x维另两维用到时再分配
} catch (OutOfMemoryError e) {
System.out.println("OutOfMemoryError found for frog, force it die.");
this.alive = false;
return;
}
for (Organ org : organs)
org.init(this);
}
/** Find a organ in frog by organ's name */
public Organ findOrganByName(String organName) {// 根据器官名寻找器官
/** Find a organ in frog by organ's class name */
@SuppressWarnings("unchecked")
public <T extends Organ> T findOrganByName(String organName) {// 根据器官类名寻找器官,不常用
for (Organ o : organs)
if (organName.equalsIgnoreCase(o.getClass().getSimpleName()))
return o;
return (T) o;
return null;
}
/** Active all cubes in organ with given activeValue */
public void activeOrgan(Organ o, float activeValue) {// 激活与器官重合的所有脑区
public void activeOrgan(Organ o, float active) {// 激活与器官重合的所有脑区
if (!alive)
return;
for (int x = o.x; x < o.x + o.xe; x++)
for (int y = o.y; y < o.y + o.ye; y++)
for (int z = o.z; z < o.z + o.ze; z++)
cubes[x][y][z].active = activeValue;
getCube(x, y, z).setActive(active);
}
/** Deactivate all cubes in organ with given activeValue */
public void deactivateOrgan(Organ o) {// 激活与器官重合的所有脑区
if (!alive)
return;
for (int x = o.x; x < o.x + o.xe; x++)
for (int y = o.y; y < o.y + o.ye; y++)
for (int z = o.z; z < o.z + o.ze; z++)
cubes[x][y][z].active = 0;
getCube(x, y, z).setActive(0);
}
/** Calculate organ activity by add all organ cubes' active value together */
@ -106,7 +108,7 @@ public class Frog {
for (int x = o.x; x < o.x + o.xe; x++)
for (int y = o.y; y < o.y + o.ye; y++)
for (int z = o.z; z < o.z + o.ze; z++)
activity += this.cubes[x][y][z].active;
activity += this.getCube(x, y, z).getActive();
return activity;
}
@ -119,7 +121,7 @@ public class Frog {
}
energy -= 20;
for (Organ o : organs) {
o.active(this); // 调用每个器官的active方法如果重写了的话
o.active(this); // 调用每个器官的active方法 通常只用于执行器官的外界信息输入、动作输出,脑细胞的遍历不是在这一步
}
return alive;
}
@ -130,4 +132,23 @@ public class Frog {
g.drawImage(frogImg, x - 8, y - 8, 16, 16, null);
}
/** Check if cube exist */
public boolean existCube(int x, int y, int z) {// 检查指定坐标Cube是否存在
return cubes[x] != null && cubes[x][y] != null && cubes[x][y][z] != null;
}
/** Get a cube in position (x,y,z), if not exist, create a new one */
public Cube getCube(int x, int y, int z) {// 获取指定坐标的Cube如果为空则在指定位置新建Cube
if (cubes[x] == null)
cubes[x] = new Cube[Env.FROG_BRAIN_YSIZE][];
if (cubes[x][y] == null)
cubes[x][y] = new Cube[Env.FROG_BRAIN_ZSIZE];
if (cubes[x][y][z] == null) {
Cube cube = new Cube();
cubes[x][y][z] = cube;
return cube;
} else
return cubes[x][y][z];
}
}

@ -141,7 +141,7 @@ public class BrainPicture extends JPanel {
/** 画点固定以top视角的角度所以只需要在x1,y1位置画一个点 */
public void drawCubeCenter(float x, float y, float z) {
drawPoint(x+0.5f, y+0.5f, z+0.5f, pointDia);
drawPoint(x + 0.5f, y + 0.5f, z + 0.5f, pointDia);
}
/** 画点固定以top视角的角度所以只需要在x1,y1位置画一个点 */
@ -171,7 +171,7 @@ public class BrainPicture extends JPanel {
Graphics g = this.getGraphics();
g.setColor(color);
g.fillOval((int) round(x1) + Env.FROG_BRAIN_DISP_WIDTH / 2 + xOffset,
(int) round(y1) + Env.FROG_BRAIN_DISP_WIDTH / 2 + yOffset - diameter/2, diameter, diameter);
(int) round(y1) + Env.FROG_BRAIN_DISP_WIDTH / 2 + yOffset - diameter / 2, diameter, diameter);
}
private static final Color[] rainbow = new Color[] { RED, ORANGE, YELLOW, GREEN, CYAN, BLUE, MAGENTA };
@ -201,7 +201,9 @@ public class BrainPicture extends JPanel {
return Color.MAGENTA;
}
public void drawBrainPicture(Frog frog) {
public void drawBrainPicture(Frog f) {
if (!f.alive)
return;
if (!Env.SHOW_FIRST_FROG_BRAIN)
return;
Graphics g = this.getGraphics();
@ -210,22 +212,24 @@ public class BrainPicture extends JPanel {
g.setColor(Color.black); // 画边框
g.drawRect(0, 0, brainDispWidth, brainDispWidth);
for (Organ organ : frog.organs)// 每个器官负责画出自已在脑图中的位置和形状
organ.drawOnBrainPicture(frog, this); // each organ draw itself
for (Organ organ : f.organs)// 每个器官负责画出自已在脑图中的位置和形状
organ.drawOnBrainPicture(f, this); // each organ draw itself
this.setColor(Color.RED);
drawLine(0, 0, 0, 1, 0, 0);
drawLine(0, 0, 0, 0, 1, 0);
drawLine(0, 0, 0, 0, 0, 1);
for (int x = 0; x < Env.FROG_BRAIN_XSIZE; x++) {
for (int y = 0; y < Env.FROG_BRAIN_YSIZE; y++) {
for (int z = 0; z < Env.FROG_BRAIN_ZSIZE; z++) {
if (frog.cubes[x][y][z].active > 0) {
setColor(rainboColor(frog.cubes[x][y][z].active));
drawCubeCenter(x, y, z);
}
if (f.cubes[x] != null)
for (int y = 0; y < Env.FROG_BRAIN_YSIZE; y++) {
if (f.cubes[x][y] != null)
for (int z = 0; z < Env.FROG_BRAIN_ZSIZE; z++) {
if (f.existCube(x, y, z)) {
setColor(rainboColor(f.getCube(x, y, z).getActive()));
drawCubeCenter(x, y, z);
}
}
}
}
}
}

@ -17,12 +17,10 @@ package com.github.drinkjava2.frog.brain;
* @since 1.0
*/
public class Cell {
public static final float MAX_ENERGY_LIMIT = 100.0f;
// this cell belong to frog's which organ
public Organ organ;
public byte cellType; // 这个细胞的类型
// energy of cell, energy got from food
public float energy; // 每个细胞当前的能量值
public float tire; // 每个细胞的疲劳值
}

@ -24,24 +24,34 @@ import java.util.Arrays;
*/
public class Cube {
/** Activity of current cube */
public float active = 0; // 这个立方体的激活程度,允许是负值,它反映了在这个小立方体里所有光子的能量汇总值
private float active = 0; // 这个立方体的激活程度,允许是负值,它反映了在这个小立方体里所有光子的能量汇总值
/**
* Fat of brain nerve cell <br/>
* 2.使
*/
public float fat = 0;
private Cell[] cells = null;
public Cell[] cells = new Cell[] {};
private Photon[] photons = null;
public Photon[] photons = new Photon[] {};
public Cell[] getCells() {// 为了节约内存仅在访问cells时创建它的实例
if (cells == null)
cells = new Cell[] {};
return cells;
}
public Photon[] getPhotons() {// 为了节约内存仅在访问photons时创建它的实例
if (photons == null)
photons = new Photon[] {};
return photons;
}
public void addCell(Cell cell) {// 每个方格空间可以存在多个脑细胞
if (cells == null)
cells = new Cell[] {};
cells = Arrays.copyOf(cells, cells.length + 1);
cells[cells.length - 1] = cell;
}
public void addPhoton(Photon p) {// 每个方格空间可以存在多个光子
if (photons == null)
photons = new Photon[] {};
for (Photon old : photons)
if (old.energy < 0.01 && p.energy > -0.01) {// 如果能量没有了,用新的代替空位
old.x = p.x;
@ -54,7 +64,12 @@ public class Cube {
photons[cells.length - 1] = p;
}
public void removePhoton(int i) {// 清除光子
photons[i].energy = 0;
public float getActive() {
return active;
}
public void setActive(float active) {
this.active = active;
}
}

@ -71,13 +71,13 @@ public class MouseAction implements MouseListener, MouseWheelListener, MouseMoti
}
if (buttonPressed == 2) {// 平移
if (e.getX() > x)
brainPic.xOffset++;
brainPic.xOffset+=6;
if (e.getX() < x)
brainPic.xOffset--;
brainPic.xOffset-=6;
if (e.getY() > y)
brainPic.yOffset++;
brainPic.yOffset+=6;
if (e.getY() < y)
brainPic.yOffset--;
brainPic.yOffset-=6;
x = e.getX();
y = e.getY();
}

@ -24,7 +24,7 @@ public class A extends Organ {
private static final long serialVersionUID = 1L;
public A() {
x = 30;
x = 10;
y = 10;
z = Env.FROG_BRAIN_ZSIZE - 1;
xe = 3;

@ -24,7 +24,7 @@ public class B extends Organ {
private static final long serialVersionUID = 1L;
public B() {
x = 30;
x = 10;
y = 15;
z = Env.FROG_BRAIN_ZSIZE - 1;
xe = 3;

@ -24,7 +24,7 @@ public class C extends Organ {
private static final long serialVersionUID = 1L;
public C() {
x = 35;
x = 15;
y = 10;
z = Env.FROG_BRAIN_ZSIZE - 1;
xe = 3;

@ -0,0 +1,40 @@
/*
* Copyright 2018 the original author or authors.
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
* applicable law or agreed to in writing, software distributed under the
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
* OF ANY KIND, either express or implied. See the License for the specific
* language governing permissions and limitations under the License.
*/
package com.github.drinkjava2.frog.brain.organ;
import com.github.drinkjava2.frog.brain.Organ;
/**
* Cone is a cone-cylinder shape brain organ, its size, angle, location and cell
* parameters are randomly created
*
* Cone
* Cone
*
* @author Yong Zhu
* @since 2.0.2
*/
public class Cone extends Organ {
private static final long serialVersionUID = 1L;
public float startX; // 这6个变量定义了cone的中心线起点和终点
public float startY;
public float startZ;
public float endX;
public float endY;
public float endZ;
public float startR = 8; // 起点的半径
public float endR = 8; // 终点的半径
public int startType = 0; // 起点端面类型, 0表示范围一直延长到边界, 1表示是个以startR为半径的球面
public int endType = 0; // 终点端面类型, 0表示范围一直延长到边界, 1表示是个以startR为半径的球面
}

@ -24,7 +24,7 @@ public class D extends Organ {
private static final long serialVersionUID = 1L;
public D() {
x = 35;
x = 15;
y = 15;
z = Env.FROG_BRAIN_ZSIZE - 1;
xe = 3;

@ -19,32 +19,50 @@ import com.github.drinkjava2.frog.brain.Organ;
*
* @author Yong Zhu
*/
public class Eye extends Organ {//这个眼睛有nxn个感光细胞可以看到青蛙周围nxn网络内有没有食物
public class Eye extends Organ {// 这个眼睛有nxn个感光细胞可以看到青蛙周围nxn网络内有没有食物
private static final long serialVersionUID = 1L;
public int n = 18; // 眼睛有n x n个感光细胞 用随机试错算法自动变异(加1或减1最小是3x3)
@Override
public void init(Frog f) { // 仅在Frog生成时这个方法会调用一次缺省啥也不干通常用于Organ类的初始化
if (!initilized) {
initilized = true;
initilized = true;
}
}
}
public Eye() {
x = 10;
y = 10;
z = Env.FROG_BRAIN_ZSIZE-1;
xe = 10;
ye = xe;
ze = 1;
x = 0;
y = 5;
z = 5;
xe = 1;
ye = 10;
ze = 10;
}
/**
* Accept a byte[x][y] array, active tubes located on eye's retina
*
*
*/
public void seeImage(Frog f, byte[][] pixels) {
if (!f.alive)
return;
int w = pixels.length;
int h = pixels[0].length;
// 在视网膜上产生字母像素点阵即激活这个脑视网膜所在的cubes区然后由器官播种出的脑细胞负责将激活能量转为光子输送、存贮到其它位置
for (int px = 0; px < w; px++)
for (int py = 0; py < h; py++)
if (pixels[px][py] > 0)
f.getCube(0, this.y + this.ye - px, this.z + py).setActive(20);
}
@Override
public void active(Frog f) {// 如果看到食物就在视网膜所在位置的cube上产生一些光子
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
if (Env.foundAnyThing(f.x - n/2 + i, f.y - n /2 + j)) {
if (Env.foundAnyThing(f.x - n / 2 + i, f.y - n / 2 + j)) {
}
}
}

@ -12,7 +12,7 @@ package com.github.drinkjava2.frog.objects;
import com.github.drinkjava2.frog.Env;
import com.github.drinkjava2.frog.Frog;
import com.github.drinkjava2.frog.brain.Organ;
import com.github.drinkjava2.frog.brain.organ.Eye;
import com.github.drinkjava2.frog.util.RandomUtils;
import com.github.drinkjava2.frog.util.StringPixelUtils;
@ -28,7 +28,7 @@ import com.github.drinkjava2.frog.util.StringPixelUtils;
*/
public class LetterTester implements Object {
private static final String STR = "ABCD";
boolean[][] pixels;
byte[][] pixels;
String letter;
@Override
@ -46,15 +46,8 @@ public class LetterTester implements Object {
pixels = StringPixelUtils.getSanserif12Pixels(letter);
}
Frog f = Env.frogs.get(screen * Env.FROG_PER_SCREEN);
Organ eye = f.findOrganByName("eye");
int w = pixels.length;
int h = pixels[0].length;
// 在视网膜上产生字母像素点阵即激活这个脑视网膜所在的cubes区然后由器官播种出的脑细胞负责将激活能量转为光子输送、存贮到其它位置
for (int x = 0; x < w; x++)
for (int y = 0; y < h; y++)
if (pixels[x][y])
f.cubes[x + eye.x][y + eye.y][eye.z].active = 20;
Eye eye = f.findOrganByName("eye");
eye.seeImage(f, pixels);
if (Env.step < Env.STEPS_PER_ROUND / 2) {// 前半段同时还要激活与这个字母对应脑区
f.activeOrgan(f.findOrganByName(letter), 20);

@ -27,14 +27,14 @@ import java.util.Map;
* @since 2.0.2
*/
public class StringPixelUtils {
private static final Map<String, boolean[][]> lettersMap = new HashMap<>();
private static final Map<String, byte[][]> lettersMap = new HashMap<>();
public static boolean[][] getSanserif12Pixels(String s) {
public static byte[][] getSanserif12Pixels(String s) {
return getStringPixels(Font.SANS_SERIF, Font.PLAIN, 12, s);
}
/* 在内存 BufferedImage里输出文本并获取它的像素点 */
public static boolean[][] getStringPixels(String fontName, int fontStyle, int fontSize, String s) {
public static byte[][] getStringPixels(String fontName, int fontStyle, int fontSize, String s) {
String key = new StringBuilder(fontName).append("_").append(fontStyle).append("_").append(fontSize).append("_")
.append(s).toString();
if (lettersMap.containsKey(key))
@ -49,25 +49,25 @@ public class StringPixelUtils {
int strHeight = fm.getAscent() + fm.getDescent() - 3;
int strWidth = fm.stringWidth(s);
g2d.drawString(s, 0, fm.getAscent() - fm.getLeading() - 1);
boolean[][] b = new boolean[strWidth][strHeight];
byte[][] b = new byte[strWidth][strHeight];
for (int y = 0; y < strHeight; y++)
for (int x = 0; x < strWidth; x++)
if (bi.getRGB(x, y) == -1)
b[x][strHeight-y-1] = true;
b[x][strHeight-y-1] = 1;
else
b[x][strHeight-y-1] = false;
b[x][strHeight-y-1] = 0;
lettersMap.put(key, b);
return b;
}
public static void main(String[] args) {
boolean[][] c = getStringPixels(Font.SANS_SERIF, Font.PLAIN, 12, "Test点阵输出");
byte[][] c = getStringPixels(Font.SANS_SERIF, Font.PLAIN, 12, "Test点阵输出");
int w = c.length;
int h = c[0].length;
for (int y = 0; y < h; y++) {
for (int x = 0; x < w; x++) {
if (c[x][h-y-1])
if (c[x][h-y-1]>0)
System.out.print("*");
else
System.out.print(" ");

Binary file not shown.

@ -7,4 +7,4 @@ LongFer
蠟일嫁
커품澗흙悧띨:98.88禱
目前支出总额:0元
目前支出总额:0元

@ -57,7 +57,8 @@ git reset --hard ae34b07e 可以转回到2019-08-04提交的分组测试的找
### 2019-06-26, Commit: Back to many connections
找食效率太低又改回到4.12的用连接数量代替权值这个逻辑权值这种人为设计的算法居然比不过随机试错失败。先暂时去掉Pain器官Pain的加入并没有提高找食效率必须与感光细胞合用才能知道是哪个方向的边界下个版本急需引入记忆功能也就是说要将感光细胞的活跃和痛苦器官的活跃关联起来。
### 2019-06-28, Commit: New eye & dynamic show brain 为了更方便青蛙看到边界又加了个新的眼睛它是一个可自进化的nxn点阵的眼睛将来会取代只有四个象素点(但能看得远)的老眼睛。到目前为止,依然还没有进行模式识别和记忆功能的开发。另外脑图可以动态显示了,用一个红圈标记出被动态跟踪显示的青蛙。另外每次运行前打印往生咒,以示对生命的尊重。
### 2019-06-28, Commit: New eye & dynamic show brain
为了更方便青蛙看到边界又加了个新的眼睛它是一个可自进化的nxn点阵的眼睛将来会取代只有四个象素点(但能看得远)的老眼睛。到目前为止,依然还没有进行模式识别和记忆功能的开发。另外脑图可以动态显示了,用一个红圈标记出被动态跟踪显示的青蛙。另外每次运行前打印往生咒,以示对生命的尊重。
### 2019-07-28, Commit: Trap & Active & Chance
这还是一个常规版本,建立在随机连接、优胜劣汰基础上。主要有以下改动:
@ -71,11 +72,14 @@ git reset --hard ae34b07e 可以转回到2019-08-04提交的分组测试的找
### 2019-08-04, Commit: Screen group test
引入分屏测试功能如果青蛙数量多可以分屏来测试每屏青蛙的数量可以少到只有1只。
2019-08-05 commit: Seesaw
### 2019-08-05 commit: Seesaw
有了分屏测试功能后,顺便随手加上了一个青蛙走跷跷板自动平衡的演示,它每次只出场一个青蛙, 每轮包括100场测试大约跑90多轮半个小时(电脑慢)后,出现了下面的画面:
![result5](https://gitee.com/drinkjava2/frog/raw/master/result5_seesaw.gif)
这个版本的目的是为了增加一点趣味性,显得青蛙还是有点"用处"的,省得让人以为这个项目不务正业,只会让青蛙找食。这个版本青蛙的脑结构和找食版的青蛙基本相同,区别只是在于环境不同,也就是说它的表现随着环境而变化,这符合"通用人工智能"的概念,即信号感受器官是统一的(通常是眼睛)但能根据不同的环境完成不同的任务。走跷跷板演示是最后一个2维脑的版本今后这个项目将沉寂一段较长时间今后将致力于将青蛙脑重构为3D金字塔形脑结构(见上文)因为这个项目的缺点已经很明显它不具备对2维图像的模式识别能力用随机试错的方式只能处理非常简单的、信号在视网膜的固定区域出现的图像信号。
青蛙的找食效率以及走跷跷板平衡的能力都没有优化到顶点,一些构想中的复杂的器官如“与门”、“或门”(不要怀疑大自然能否进化出这些复杂器官)等都没加上但我认为这不重要目前最高优先级是先进行3D脑结构建模让青蛙能具备2维图形的模式识别(和回忆)功能,这个大的架构重构是它能处理复杂图像信息的立足之本,它的图像识别能力和通常的用上千张图片来训练识别一个图片这种工作模式不同,它是一种通用的,可自动分类识别所有图像的模式,更符合动物脑的工作模式,记住并回忆出某个图像(或任意输入信号场景的组合),可能只需要这种场景重复出现过几次即可,它是一种无外界信号判定,自动分类的识别模式。
2019-09-09 commit: start work on 3d
开始进行3D脑的实际编程。
### 2019-09-09 commit: start work on 3d
开始进行3D脑的实际编程。
### 2019-9-09 到 2019-10-06 之间的6次提交
主要进行脑框架的显示和字母试别测试环境的搭建还没开始进行利用器官进行脑细胞播种的工作。这一阶段基本思路是在每一轮的测试过程前半段随机显示ABCD其中的一个字母(即激活视网膜所在的脑区),并同时激活一个任意脑区。在下半段则只激活这个字母的点阵,然后检测对应的这个脑区是否也会激活,如果激活的话,将会增加青蛙的能量值,让它在生存竟争中胜出,这一步是要完成基本的模式识别功能,框架已搭好,但器官的随机生成还没进行,这一步比较复杂,除了器官的大小位置等参数外,神经元的参数也多,比方说输入、输出光子的方向、正负、数量,能量吸收、释放比例,输入输出阀值、疲劳值、疲劳阀值等,这么多参数要利用随机生成器官的方式来筛选,需要的样本数量多,运行时间会比较长。早期是视网膜和识别区在脑长方体的同一侧,后来的提交改为将视网膜移到左侧,也就是说视觉与识别区(对应耳朵的语音区)在物理上呈90度正交以方便观察和编程。
Loading…
Cancel
Save