stuck, will change to one way version

pull/1/head
Yong Zhu 7 years ago
parent 0efc6b9021
commit 0d112e2256

@ -118,23 +118,23 @@ public class Frog {
}
for (Cell cell : cells) {
// 输入部分
for (Input input : cell.inputs) {
// 如果食物出现在视觉区激活对应frog视觉区的输入触突
if (input.x > (-eyeRadius) && input.y > (-eyeRadius) && input.x < eyeRadius && input.y < eyeRadius) {
int xx = x + input.roundX();
int yy = y + input.roundY();
if (xx > 0 && xx < env.ENV_XSIZE && yy > 0 && yy < env.ENV_YSIZE && env.foods[xx][yy] > 0)
input.energy += 500;
}
// 如果任意输入触突激活,增加对应细胞的输出区激活
if (input.energy > 50)
cell.activateOutputs();
// 即使什么也不干input的能量总在以95%的速度下降
input.energy *= .95;
}
// // 输入部分
// for (Input input : cell.inputs) {
// // 如果食物出现在视觉区激活对应frog视觉区的输入触突
// if (input.x > (-eyeRadius) && input.y > (-eyeRadius) && input.x < eyeRadius && input.y < eyeRadius) {
// int xx = x + input.roundX();
// int yy = y + input.roundY();
// if (xx > 0 && xx < env.ENV_XSIZE && yy > 0 && yy < env.ENV_YSIZE && env.foods[xx][yy] > 0)
// input.energy += 500;
// }
//
// // 如果任意输入触突激活,增加对应细胞的输出区激活
// if (input.energy > 50)
// cell.activateOutputs();
//
// // 即使什么也不干input的能量总在以95%的速度下降
// input.energy *= .95;
// }
// 如果输出触突位于运动区且兴奋则frog移动一个单位
for (Output output : cell.outputs) {

Binary file not shown.
Loading…
Cancel
Save