-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Step 1: Implement A "Save State" Mechanism #2
Open
mfekadu
wants to merge
9
commits into
master
Choose a base branch
from
save-state
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Commits on Sep 8, 2019
-
this commit was an attempt to "just make it work" so the code is not elegant dumping the space is as simple as `pickle.dump(space)` but I cannot dump `pickle.dump([space, window, options])` TODO: explore dumping window TODO: explore dumping options The zip files are folders that contain the dumps You need to unzip the folders in order to run `./replay` replay.py is the script to do "replay" It will search for the first folder it finds in "space_dumps" directory Then it will `pickle.load` each file in that folder it found Then we need to `space.step()` to actually have each space displayed on the screen in sequential order OH BTW... sorting the files is important.... otherwise it looks weird and jumpy DUMPS_DIR added to cfg.py TODO: figure out how to also dump the cfg.py data TODO: figure out how to minimize `replay.py` because ideally replay.py can just do everything given the file & not need to perform any sort of setup * for example replay.py needs to have the collision handler functions inside otherwise an error about "missing begin_collision in __main__" will occur
Configuration menu - View commit details
-
Copy full SHA for 4523b95 - Browse repository at this point
Copy the full SHA 4523b95View commit details -
minimizing replay.py code to just the essentials also include scrubbing via arrow keys * holding right scrubs forward * holding left scrubs in reverse * UP/DOWN scrub faster still TODO: * import gzip into replay.py and sim.py * sim.py should batch pickle.dump and gzip at the end * replay.py should ungzip a given dump_file and also load it up for replay * AVOID doing `import cfg` into replay.py * because cfg.py could change in the future * rather sim.py should save all of the replay values into the dump_file (save just once.... not into each dump_file... save into its own file) * Here's an IDEA: * save replay.py with each batch of dump_files.zip.... that way every dump_files.zip will have a functional replay.... and replay can just be a script that works specifically for each batch of files. Self-contained. Would be nice. Could be annoying to have to recreate the replay.py script each time... but assuming sim.py will continue to change then replay.py will likely change along with it... so maybe that's the optimal solution? hmmm...
Configuration menu - View commit details
-
Copy full SHA for 715691d - Browse repository at this point
Copy the full SHA 715691dView commit details -
use list-comprehension properly in replay.py
because removing an element from a list that you are iterating over can be weird
Configuration menu - View commit details
-
Copy full SHA for 589354d - Browse repository at this point
Copy the full SHA 589354dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5cbfc8b - Browse repository at this point
Copy the full SHA 5cbfc8bView commit details
Commits on Sep 9, 2019
-
* replay.py now is a command-line utility * it does argparse of the dumps_dir * replay.py is much more minimal and cool and not hard coded * replay.py now includes a “version number” `v1.0` in the filename * Also the name says ’space_and_cfg_ to let you know what to expect out of the pickle.load deleted the old incompatable pickle.dumps include just 1 zip file containing space_and_cfg pickles TODO: optimize the pickle.dump of cfg because it only needs to be done once. But for now the redundancy is fine because cfg only takes about 1KB... but 1KB * 1000 files would be 1MB... etc ...
Configuration menu - View commit details
-
Copy full SHA for 03bacc4 - Browse repository at this point
Copy the full SHA 03bacc4View commit details
Commits on Sep 10, 2019
-
try climbing the abstraction ladder
before we had concrete position details of the yellow circle... but now we can wait helllllla long (like 30 seconds for 2000+ frames) to load and display each position of the bot over all time frames. Looks cool but it takes too long and needs too much data TODO: compress the pickle files somehow or dont save the entire space... maybe save useful statistics like "position over time" or "velocity" or "other stuff liike that" and save the functions to recreate the shapes but not the shapes themselves. And maybe dont use pymunk to replay. Maybe just plot the positions using matplotlib. ...
Configuration menu - View commit details
-
Copy full SHA for b7889fe - Browse repository at this point
Copy the full SHA b7889feView commit details
Commits on Sep 14, 2019
-
refactor main() to slowly make it smaller
created init_food(...) has purpose statement with clear explanation of inputs no longer afraid to pass in the space object reference because now I know that's a "reference" in python and not a giant object value
Configuration menu - View commit details
-
Copy full SHA for 0719210 - Browse repository at this point
Copy the full SHA 0719210View commit details
Commits on Sep 16, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 3edfeaf - Browse repository at this point
Copy the full SHA 3edfeafView commit details -
no more global variables keyboard interaction simplified (soon to be removed from sim.py) helper functions
Configuration menu - View commit details
-
Copy full SHA for 1718e69 - Browse repository at this point
Copy the full SHA 1718e69View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.