displayHeight = 800

ballPosition = np.array([ np.random.rand(), np.random.rand() * 0.5 + 0.5 ])

ballVelocity = np.array([ 0.653, 1.0 ]) * 0.04

paddleX = 0.5

ballRadius = 16.0 / displayWidth
paddleRadius = 64.0 / displayWidth

encoderSize = 20
numInputs = 5
numActions = 4

a = Agent(numInputs * encoderSize, numActions, [ 200 ], -0.1, 0.1, 0.04)

averageReward = 0.0

reward = 0.0
prevReward = 0.0

rewardPunishmentTime = 2.0
punishmentTimer = 0.0
rewardTimer = 0.0

# Resources
ballImage = pygame.image.load("ball.png")
paddleImage = pygame.image.load("paddle.png")

# Game setup
Example #2
0
displayHeight = 600

ballPosition = np.array([np.random.rand(), np.random.rand() * 0.5 + 0.5])

ballVelocity = np.array([0.353, 1.0]) * 0.04

paddleX = 0.5

ballRadius = 16.0 / displayWidth
paddleRadius = 64.0 / displayWidth

encoderSize = 10
numInputs = 5
numActions = 1

a = Agent(numInputs * encoderSize, numActions, [50, 50], -0.1, 0.1, 0.1)

averageReward = 0.0

reward = 0.0
prevReward = 0.0

rewardPunishmentTime = 2.0
punishmentTimer = 0.0
rewardTimer = 0.0

# Resources
ballImage = pygame.image.load("ball.png")
paddleImage = pygame.image.load("paddle.png")

# Game setup
Example #3
0
displayHeight = 600

ballPosition = np.array([np.random.rand(), np.random.rand() * 0.5 + 0.5])

ballVelocity = np.array([0.353, 1.0]) * 0.04

paddleX = 0.5

ballRadius = 16.0 / displayWidth
paddleRadius = 64.0 / displayWidth

encoderSize = 10
numInputs = 5
numActions = 1

a = Agent(numInputs * encoderSize, numActions, [50, 50], -0.1, 0.1, 0.1)

averageReward = 0.0

reward = 0.0
prevReward = 0.0

rewardPunishmentTime = 2.0
punishmentTimer = 0.0
rewardTimer = 0.0

# Resources
ballImage = pygame.image.load("ball.png")
paddleImage = pygame.image.load("paddle.png")

# Game setup