diff --git a/README_CN.md b/README_CN.md new file mode 100644 index 0000000..e69de29 diff --git a/elevator_saga/client/base_controller.py b/elevator_saga/client/base_controller.py index 242509f..1ae4c22 100644 --- a/elevator_saga/client/base_controller.py +++ b/elevator_saga/client/base_controller.py @@ -34,7 +34,7 @@ class ElevatorController(ABC): self.debug = debug self.elevators: List[Any] = [] self.floors: List[Any] = [] - self.current_tick = 0 + self.current_tick = -2 self.is_running = False self.current_traffic_max_tick: Optional[int] = None @@ -173,7 +173,7 @@ class ElevatorController(ABC): """内部初始化方法""" self.elevators = elevators self.floors = floors - self.current_tick = 0 + self.current_tick = -2 # 调用用户的初始化方法 self.on_init(elevators, floors) diff --git a/elevator_saga/server/simulator.py b/elevator_saga/server/simulator.py index 2ac514a..51b05a3 100644 --- a/elevator_saga/server/simulator.py +++ b/elevator_saga/server/simulator.py @@ -186,7 +186,7 @@ class ElevatorSimulation: traffic_file = self.traffic_files[self.current_traffic_index] server_debug_log(f"Loading traffic from {traffic_file.name}") try: - with open(traffic_file, "r") as f: + with open(traffic_file, "r", encoding="utf-8")as f: file_data = json.load(f) building_config = file_data["building"] server_debug_log(f"Building config: {building_config}") diff --git a/setup.py b/setup.py index cbd979b..43ee6f4 100644 --- a/setup.py +++ b/setup.py @@ -36,7 +36,8 @@ setup( "numpy>=1.20.0", "matplotlib>=3.5.0", "seaborn>=0.11.0", - "pandas>=1.3.0", + "pandas>=1.3.0",, + "flask ], extras_require={ "dev": [