-
I'm currently working on implementing my own env that is partially related to SDVRP env. rl4co/rl4co/envs/routing/sdvrp/env.py Lines 132 to 140 in b516158 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi @ShuN6211 ! The current node may not be masked only if it is the depot: mask_depot = (td["current_node"] == 0).squeeze(-1) & ( # (1)
(mask_loc == 0).int().sum(-1) > 0 # (2)
) this means roughly: "you cannot go to the depot if (1) you are already at the depot (which has index 0) and (2) there are still unvisited node that you can visit outside of it" Note that if the episode is over, you are always allowed to stay in the depot indefinetely to wait for other episodes in the same batch to finish. Does this answer your question? :) |
Beta Was this translation helpful? Give feedback.
Hi @fedebotu! Thanks for answering!! I feel we need more discussion on the topic!
I understand this point. 👌 My concern is about the locs rather than the depot.
In my understanding, this means "you can go to the loc that still haves unfilled demand, but if remaining vehicle capacity is empty, you can't go to any of locs " ...Oh, I understand the things during editing this message!!
I suspected the constructive policy(Decoding strategy's step) may…