GFTargetingBot

From Robowiki
Revision as of 18:53, 22 February 2008 by Jlm0924 (talk | contribs) (New page: I'm new to java, and my lack of understanding Java has me hung up on this key peice of code: buffer = statBuffers[distanceIndex][velocityIndex][lastVelocityIndex]; from my understanding...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

I'm new to java, and my lack of understanding Java has me hung up on this key peice of code:

  buffer = statBuffers[distanceIndex][velocityIndex][lastVelocityIndex];

from my understanding; buffer is an array of 25 (ints), each bin being a counter of times visted. And statBuffers is a 4dimesional array of size: 5(int), 5(int), 5(int),and 25(int) : private static int[][][][] statBuffers = new int[DISTANCE_INDEXES][VELOCITY_INDEXES][VELOCITY_INDEXES][BINS]; so back to the problem code : buffer = statBuffers[distanceIndex][velocityIndex][lastVelocityIndex];

so the above "indexes" (0-4) should retrieve the values in thoses locations in the statBuffers arrays.. Am I wrong so Far ? It seems to me were assigning apples to oranges here? How does it work ? .. - Justin