This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Inspired by | |
#https://github.com/Kautenja/nes-py/blob/master/nes_py/wrappers/binary_to_discrete_space_env.py | |
#and | |
#https://github.com/openai/retro-baselines/blob/master/agents/sonic_util.py | |
#but copying directly from neither. | |
#Requires retro. | |
#Requires SuperMarioBros NES rom (USA/Japan). Once you have it, can be imported to retro: | |
#> python -m retro.import directory_name | |
#(identifies the ROM if it is there and has the .nes extension.) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%@EliasHasle | |
%There probably is room for more optimization in the form of vectorization. | |
%You see, Matlab is not my first language. | |
function [ values ] = ball_bounce( initials, k, tt) | |
%Input: | |
%initials: column vector of initial vertical position and velocity | |
%k: coefficient of restitution (must be less than one) | |
%tt: array of times | |
% |