suessmann / intelligent_traffic_lights

Traffic Lights Control with Deep Learning
MIT License
68 stars 14 forks source link

What is Reward? #11

Open MinHongSun opened 2 years ago

MinHongSun commented 2 years ago

Hello. First of all, thank you for your public source. I have a question. I wonder what Reward means in this model. Usually, the queue is Reward for other models, but I think this model is different. What does Reward mean?

TrinhTuanHung2021 commented 2 years ago

Hello. First of all, thank you for your public source. I have a question. I wonder what Reward means in this model. Usually, the queue is Reward for other models, but I think this model is different. What does Reward mean?

Hello. This is reward function

    def _get_reward(self):
        if self.time < 4:
            return 0

        self.r_w = 0.85 * self.waiting_time_float_av[-2] - self.waiting_time_float_av[-1]

        # if self.r_w < 0:
        #     self.r_w *= 1.5
        #
        # self.r_av.append(self.r_w)

        return self.r_w