Shadab442 / dqn-leo-handover-python

DQN based Handover Optimization for LEO Satellites in NTN
20 stars 4 forks source link

Questions about the code #5

Open hui42376 opened 10 months ago

hui42376 commented 10 months ago

Thank you for your answering, I created a list of previous candidate satellites, and then based on the index corresponding to the previous action and the current action, whether the elements in the previous candidate satellite list and the current candidate satellite list are the same if they are the same, a reward of 25 will be given. Its performance is good .I have four questions. One is (LeoEnv class def compute_reward is when setting the conditions for rewards, whether it is necessary to set the value less than if np.dot(t_serv, action) according to the specific value of del_t and num_times set by the simulation, such as det_t=5, num_times=10, would it be better to set if np.dot(t_serv, action) < 0.5, because the minimum value of np.dot(t_serv, action) is 0.5 and the maximum is 5. The second is setting When self.timestamps = np.arange(self.num_times) * (20/60), does (20/60) mean del_t=10, num_times=30? I need to adjust the corresponding self according to the specific settings of del_t and num_times. .timestamps. Third, when I run the source code, a "ValueError: Negative dimensions are not allowed" error will appear, but if I adjust num_times to a smaller value, to 20 or 10, the code will run normally. Last, I was wondering how 17 satellites get, when i use det_t = 5, num_times = 10, there are 12 satellites.

Shadab442 commented 6 months ago
  1. Yes and no. np.dot(t_serv, action) represents the remaining service time for the satellite you have chosen to be handed over (or remain connected). If the serving time is too low, you will need to go for another handover within a short period which is not desired. The minimum threshold of the remaining service time - you can choose it by yourself. I chose it as 1 minute as this is a very short simulation. You can choose some other value dependent on your simulation time. That means it does depend on delt_t. It is just np.dot(t_serv, action) < delt_t. But it has nothing to do with num_times which defines the number of data samples.

  2. Timestamps need to be in minutes as I have used minutes as the unit of timedelta in the date_time_array_generate function under DateTimeArray class. As the num_times are just indices, I use that statement to convert it into timestamps in minutes.

  3. I am not sure about the error. You should put some print statements wherever the num_times are used to debug.

  4. I am not sure what you meant. In the uploaded file, I have 10 satellites, How can you get 17 when you try with 12? Can you send more details?