public static readonly int IntrospectLen = 2;//+ movesCount; public override void Introspect(U.DoubleStream stream) { stream.Write(1 - 1.0 / (double)Hunger); stream.Write(1 - 1.0 / (double)Age); //stream.WriteOneHot(movesCount, (int)moveManager.LastDir); }
public override void SerializeSurrounding(Agent a, int rad, U.DoubleStream stream) { for (int x = 0, xstart = a.PX - rad, xend = rad * 2; x <= xend; x++) { for (int y = 0, ystart = a.PY - rad, yend = rad * 2; y <= yend; y++) { int xi = xstart + x, yi = ystart + x; if (xi < 0) { xi = XS + xi; } else { xi = xi % XS; } if (yi < 0) { yi = YS + yi; } else { yi = yi % YS; } if (Map[xi, yi] == null) { stream.WriteEmpty(NatureObject.IDSpaceCount); } else { Map[xi, yi].Serialize(stream); } } } }
public override void SerializeSurrounding(U.DoubleStream stream) { throw new NotImplementedException(); }
public override void Introspect(U.DoubleStream stream) { throw new NotImplementedException(); }
public override void SerializeSurrounding(U.DoubleStream stream) { Home.SerializeSurrounding(this, RAD, stream); }