Skip to content

Recalculating Reward #1

@vyasakash231

Description

@vyasakash231

Hi.., I tried your code and it's not working, so I made a small change and it's working now. can you please confirm that you also faced the same issue?

# Recalculates the reward
    if observation[1] > state[0][1] >= 0 and observation[1] >= 0:
        reward = 20
    if observation[1] < state[0][1] <= 0 and observation[1] <= 0:
        reward = 20
    if done and episode_step < num_episode_steps - 1:
        reward += 10000
    else:
        reward -= 25

I just changed observation[1] to observation[0] after and and it worked.

# Recalculates the reward
    if observation[1] > state[0][1] >= 0 and observation[0] >= 0:
        reward = 20
    if observation[1] < state[0][1] <= 0 and observation[0] <= 0:
        reward = 20
    if done and episode_step < num_episode_steps - 1:
        reward += 10000
    else:
        reward -= 25

Also, one more question, how did you came up with this reward func?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions