How does the code loop through each agent to calculate its speed?
z111RL opened this issue · 4 comments
Thank you for sharing your code.I have carefully read your code and corresponding papers.I would like to ask you some questions:
In TD3PER_monitor, actions = agent.select_action(states) . Is the returned 'actions' the probability of multiple actions by one agent or the actions of multiple agents?and how does the code loop through each agent and calculate its speed? I don't quite understand this point.
Also,I have sent you an email, hoping to receive your reply!
Best wishes!
Hi,
Can you specify the file you are talking about?
I am not 100% sure, but I think that the action is only for the "ego" vehicle, so, there is only one action calculated simultaneously. But, in each time step, one action is calculated for all of the vehicles in the intersection.
For the calculation of each action, the intersection manager (IntersectionManager.py
) is used.
Sorry for the delay in the response.
Best,
Hey,
I have the same doubt as to how the code loops through each vehicle one by one, such that each vehicle is considered as the ego vehicle...
It would be really helpful if you check the mail that I have sent.
Cordially yours,
Ben Thomas
Each vehicle is ordered by its distance from the center of the intersection. Then, in the list that is created of each vehicle in the intersection, it is iterated one by one, considering the selected vehicle as ego and the rest of the vehicles as vehicles with which it has to cooperate.
Check the variable state
in the __update_state
method of IntersectionManager.py
# Looping every vehicle, to create the states
for k, v in rw_data.items():
# Highlight the vehicle selected
state = self.set_vehicle_highlight(state, k, v) # Select the ego vehicle
state = self.set_other_vehicles(state, rw_data, k) # Obtain the states of the other vehicles
I hope this clears up your doubts.
Hey,
Thank you for the clarification. That clearly resolves some issues I had. Also, Is the LSTM part in your subsequent work also included in this repository, if so kindly mention where it is included too.
Cordially yours,
Ben Thomas