jhester / DistributedGA

A distributed Genetic Algorithm simulation.
http://josiahhester.com
5 stars 0 forks source link

Packer #6

Closed anander closed 13 years ago

anander commented 13 years ago

We need a class for packing the map into a string and a class for packing the players into a string that need updating.

ghost commented 13 years ago

Either 1 per class, or 1 that handles all classes. Packer should be able to pack into a string, unpack into a class, or unpack a string and update an existing class. I'm not sure the best way to do this, we need condor so downloading new modules isn't really a good idea (right?) we could use 'struct' but I think it has site limitations. Struct seems to be designed for single variables which might work for the players as they are just id, xpos, ypos, health (int,int,int,byte) right now.

We might need to just write our own function to pack into bytes and create a string...

jhester commented 13 years ago

Lets just use a simple string parser (we have to write it ourselves), tokenize the variables into an array and pass it into a struct or class.

ghost commented 13 years ago

Pickle seems to be working, provided we only pickle a list of numbers...