Skip to content

Comments

Add create_car_id_map to map v1 car IDs to v2 agent IDs for replay conversion#60

Open
chrisrca wants to merge 1 commit intoRLGym:mainfrom
chrisrca:main
Open

Add create_car_id_map to map v1 car IDs to v2 agent IDs for replay conversion#60
chrisrca wants to merge 1 commit intoRLGym:mainfrom
chrisrca:main

Conversation

@chrisrca
Copy link

Add create_car_id_map to map v1 car IDs (1-8) to v2 agent UUIDs, enabling retrieval of v2 actions for v1 players during replay conversion with convert_game_state.

# Create the mapping from v1 car IDs to v2 agent IDs
id_map = create_car_id_map(frame.state.cars)
# Use the map to get v2 agent ID for a v1 player and retrieve actions
v2_id = id_map[v1_player.car_id]
action = frame.actions.get(v2_id, np.zeros(8, dtype=np.float32))

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.

1 participant