Skip to content
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

Optimize env logic #5

Merged
merged 2 commits into from
Feb 22, 2024
Merged

Optimize env logic #5

merged 2 commits into from
Feb 22, 2024

Conversation

helpingstar
Copy link
Owner

@helpingstar helpingstar commented Feb 22, 2024

ENG)
The calculate_expected_landing_point_x_for function is designed for the movement of computers, not humans. According to the original code at https://github.com/gorisanson/pikachu-volleyball, this function must be executed regardless of conditions. However, due to its significant computational requirements, conditions have been added to optimize the reinforcement learning environment.

The calculate_expected_landing_point_x_for function is always executed at the end of the process_collision_between_ball_and_player function. Since the calculate_expected_landing_point_x_for function is intended to determine computer movements, it is unnecessary when two people are playing. Conditions could be added to calculate_expected_landing_point_x_for within the process_collision_between_ball_and_player function, but that would require adding a player_X argument to process_collision_between_ball_and_player, altering it from its original form. To keep the process_collision_between_ball_and_player function as close to the original as possible, the calculate_expected_landing_point_x_for function, which is currently executed unconditionally at the end, will be removed and instead executed explicitly outside based on conditions.

KOR)
calculate_expected_landing_point_x_for 함수는 사람이 아닌 컴퓨터의 움직임을 위한 함수입니다. 원본 코드인 https://github.com/gorisanson/pikachu-volleyball 에 의하면 위 함수는 조건에 상관없이 무조건 실행되어야 합니다. 하지만 해당 함수는 연산량이 적지 않기 때문에 강화학습 환경의 최적화를 위해 조건을 추가하였습니다.

calculate_expected_landing_point_x_for함수는 process_collision_between_ball_and_player 함수 마지막에 무조건 실행됩니다. calculate_expected_landing_point_x_for 함수는 컴퓨터의 움직임을 결정하기 위한 함수이므로 사람 두명이서 플레이할 경우 이 함수는 실행될 필요가 없습니다. process_collision_between_ball_and_player 함수안에서 calculate_expected_landing_point_x_for에 조건을 추가할 수 있지만 그러면 process_collision_between_ball_and_player 함수에 player_X 인수를 추가해야 하므로 함수를 최대한 원본과 비슷하게 하기 위해 process_collision_between_ball_and_player 함수의 마지막에 무조건 실행되는 calculate_expected_landing_point_x_for 함수를 제거하고 밖에서 명시적으로 조건에 따라 실행될 수 있도록 합니다.


I posted an issue on the referenced code repository regarding this matter, but it was not incorporated into the original code due to the opinion that the original code should be preserved as much as possible.

원본 저장소에 이에 대한 issue 를 올렸으나, 원본 코드를 최대한 유지하시겠다는 의견으로 인하여, 원본 코드에는 반영되지 못하였습니다.

gorisanson/pikachu-volleyball#24 (comment)

@helpingstar helpingstar merged commit 6eb0d67 into main Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant