Disk space quota

From Robowiki
Revision as of 03:37, 13 March 2009 by Zyx (talk | contribs) (java knows hte size)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Little question: space for saving to file double is 64bit, one char 16bit. If i want to save the weigth for my gun i can store it to file using 1 double(weigth) and 1 char(separator), using 80bit (8 byte). 8 byte for 1000 robot is 8000 byte, and 200kb is maximum file quota (204800 byte) So for every bot in rumble i can save 204800/8000 = 25 weigth, right? If i use float(32 bit) i will gain about double space right? It can seems a stupid question but if i'm right i'm impressed how easily i can store more than 15 weigth for every bot in rumble(and much more!), giving at my gun a chance to learn specific weigth for every bot (i think the gun will be really slow to learn, due to automatics weigth finding, but actually is under development) --lestofante 15:20, 12 March 2009 (UTC)

If you know the length of a double, you actually don't need a char as a separator. Just read in doubles 64 bits at a time... it will save you disk space. You could probably use floats instead, which would be even better. An idea I had was putting the information into a long filename, so your actual filesize is 0 and doesn't contribute to the quota.--Skilgannon 18:56, 12 March 2009 (UTC)

  • Haha... I wouldn't trust the filename to store any more info than the name of the enemy bot the info is about... After all many systems have somewhat short limits on filename length, and spamming it with tons of files with 0 size yet long file names would be.... just plain rude. --Rednaxela 19:16, 12 March 2009 (UTC)
  • Hehehe, It sounds like a "good" idea, but I agree with Rednaxela about it's rudeness. About knowing the size of double, it isn't really necessary if you use the writeDouble and readDouble methods. They would write and read the appropriate number of bits. --zyx 02:37, 13 March 2009 (UTC)