TN1ck / robocup-ss13

Building the most awesome robot-soccer-team in existence.
2 stars 0 forks source link

Create Buffer for the last n worlds #43

Closed ghost closed 11 years ago

ghost commented 11 years ago

Create a buffer which saves the last n (maybe 10) world objects and add it to agent.py. Give it to the constructor of tactics_main and put all calculated distance lists/dicts in it (in run_tactics()). Maybe it would be good to create a new data structur for this buffer so that we don't have to respect a special order (like f. e. in a list) and can call the data we need by name and index.

artifactz commented 11 years ago

i don't really get your point with that new data structure, but i added a double ended queue to our agent containing the last 100 worlds. self.world_history[0] is the oldest one, self.world_history[1] is a bit fresher and so on. self.world_history[-1] is the most recent one. the capacity is still flexible atm.

artifactz commented 11 years ago

in agent there is: self.world_history with smoothed values and self.world_history_raw with values as calculated by perception. 100 perception cycles are stored. note that a perception cycle happens every 3 cycles, so world history snapshot interval is 60 ms. the history queues use a custom deepcopy which passes static enties back as reference, so they're not stored redundantly.