mirror of
https://github.com/ZGCA-Forge/Elevator.git
synced 2026-02-04 05:15:19 +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.debug = debug
|
||||||
self.elevators: List[Any] = []
|
self.elevators: List[Any] = []
|
||||||
self.floors: List[Any] = []
|
self.floors: List[Any] = []
|
||||||
self.current_tick = 0
|
self.current_tick = -2
|
||||||
self.is_running = False
|
self.is_running = False
|
||||||
self.current_traffic_max_tick: Optional[int] = None
|
self.current_traffic_max_tick: Optional[int] = None
|
||||||
|
|
||||||
@@ -173,7 +173,7 @@ class ElevatorController(ABC):
|
|||||||
"""内部初始化方法"""
|
"""内部初始化方法"""
|
||||||
self.elevators = elevators
|
self.elevators = elevators
|
||||||
self.floors = floors
|
self.floors = floors
|
||||||
self.current_tick = 0
|
self.current_tick = -2
|
||||||
|
|
||||||
# 调用用户的初始化方法
|
# 调用用户的初始化方法
|
||||||
self.on_init(elevators, floors)
|
self.on_init(elevators, floors)
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ class ElevatorSimulation:
|
|||||||
traffic_file = self.traffic_files[self.current_traffic_index]
|
traffic_file = self.traffic_files[self.current_traffic_index]
|
||||||
server_debug_log(f"Loading traffic from {traffic_file.name}")
|
server_debug_log(f"Loading traffic from {traffic_file.name}")
|
||||||
try:
|
try:
|
||||||
with open(traffic_file, "r") as f:
|
with open(traffic_file, "r", encoding="utf-8")as f:
|
||||||
file_data = json.load(f)
|
file_data = json.load(f)
|
||||||
building_config = file_data["building"]
|
building_config = file_data["building"]
|
||||||
server_debug_log(f"Building config: {building_config}")
|
server_debug_log(f"Building config: {building_config}")
|
||||||
|
|||||||
Reference in New Issue
Block a user