示例#1
0
        @Override
        public State getNextState(State state) {
          State state1 = new State(state);
          double d;
          d = Util.rand(-da, da);
          state1.ax += d;
          if (state1.ax > maxa || state1.ax < -maxa) state1.ax -= d;

          d = Util.rand(-da, da);
          state1.ay += d;
          if (state1.ay > maxa || state1.ay < -maxa) state1.ay -= d;

          d = Util.rand(-da, da);
          state1.az += d;
          if (state1.az > maxa || state1.az < -maxa) state1.az -= d;

          d = Util.rand(-dd, dd);
          state1.dx += d;
          if (state1.dx > maxd || state1.dx < -maxd) state1.dx -= d;

          d = Util.rand(-dd, dd);
          state1.dy += d;
          if (state1.dy > maxd || state1.dy < -maxd) state1.dy -= d;

          d = Util.rand(-dd, dd);
          state1.dz += d;
          if (state1.dz > maxd || state1.dz < -maxd) state1.dz -= d;

          return state1;
        }