mirror of
https://github.com/ZGCA-Forge/Elevator.git
synced 2025-12-14 13:04:41 +00:00
fix running on windows
This commit is contained in:
0
README_CN.md
Normal file
0
README_CN.md
Normal file
@@ -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)
|
||||
|
||||
@@ -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}")
|
||||
|
||||
Reference in New Issue
Block a user