Lux-AI-Challenge/Lux-Design-S2

Repeat actions are not repeated after itself

harmbuisman opened this issue · 0 comments

Repeat actions are not repeated after itself, but put at the end of the action queue. This means it is not possible to dig 10 times in one and then go home, since the action dig 10 is put as dig 9 at the end of the queue, after the bot returned home.

The problem is that the action is appended to the end of the action queue in:

    def repeat_action(self, action):
        self.action_queue.pop(0)
        if action.repeating:
            self.action_queue.append(action)
            if action.repeat != -1: 
                action.repeat -= 1

Suggestion is to only do the pop for the endless repeat -1 case