CityBrainChallenge / KDDCup2021-CityBrainChallenge-starter-kit

77 stars 40 forks source link

get_average_travel_time() does not return zero after reset the environment #25

Open moragab1993 opened 3 years ago

moragab1993 commented 3 years ago

i notice that env.eng.get_average_travel_time() only return 0 at episode 0 but from episode 1 and so on it return a value

digging into the CBEngine and looking at how the reset function works, shouldn't it return zero at each new episode ?

thanks

wangzelong0663 commented 3 years ago

I also found the the smaller value of env.eng.get_average_travel_time() of the episode don't mean the better result, so what does the env.eng.get_average_travel_time() real stand for?

namdre commented 3 years ago

@moragab1993 can you post a link to the CBEngine code?

moragab1993 commented 3 years ago

the CBEngine coda can be found here in the docker

/usr/local/lib/python3.7/dist-packages/CBEngine/envs/CBEngine.py

the reset function

def reset(self):
    del self.eng
    gc.collect()
    self.eng = citypb.Engine(self.simulator_cfg_file, self.thread_num)
    self.now_step = 0
    self.vehicles.clear()
    return self._get_observations(),self._get_info()
namdre commented 3 years ago

@moragab1993 That's only a thin wrapper. I mean the real source code of the engine (package citypb)

moragab1993 commented 3 years ago

they did't provide the source code of citypb as it is only a build .so file

namdre commented 3 years ago

Thanks. I was hoping someone found the code online.

MeixinZhu commented 3 years ago

env.eng.get_average_travel_time() will return different values even if we do not change anything.

Kanstarry9T commented 3 years ago
  1. env.eng.get_average_travel_time() returns average travel time over all vehicles (includes both vehicles that arrived the destination and are on road). For an on-road traveling vehicle, its travel time equals to current time - start_time.
  2. We will check the different values for different episode and get back to you as soon as possible.