I need to create 3000x3000 bit map for coords of my robots. In theory I have a array MxM, M=3000, and if my robot see somthing, then in coords [5][5] example I put 1, if see nothing then 0.
When I tried create
int[][] b = new int[3000][3000]
I have a problem - outofmemory.I tried use RMS, but I can create 3000 rows, but only 50 cols
I think to use textfile, but I need a custom update开发者_如何学JAVA, and working with textfile very hard in j2me.
Thanks for reply!
Some approaches:
- Store your coordinates in a file, and load and update only those rows/columns of data into memory, that surround the robot (maybe a 10x10 matrix). Buffering.
- Use a quadtree algorithm to store your coordinates. You may have to use the external file approach here too, but maybe you can think of something better.
精彩评论