pycityagent 1.1.6__py3-none-any.whl → 1.1.8__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -60,7 +60,7 @@ def get_xy_in_lane(nodes, distance, direction:str='front'):
60
60
  # 顺道路方向前进
61
61
  if distance == 0:
62
62
  return [nodes[0]['x'], nodes[0]['y']]
63
- key_index = 0
63
+ key_index = 0 # first node
64
64
  for i in range(1, len(nodes)):
65
65
  x1, y1 = nodes[i-1]['x'], nodes[i-1]['y']
66
66
  x2, y2 = nodes[i]['x'], nodes[i]['y']
@@ -70,12 +70,14 @@ def get_xy_in_lane(nodes, distance, direction:str='front'):
70
70
  break;
71
71
  key_index += 1
72
72
  if remain_s < 0.5:
73
- return [nodes[-1]['x'], nodes[-1]['y']]
73
+ return [nodes[key_index]['x'], nodes[key_index]['y']]
74
74
  longlat = point_on_line_given_distance(nodes[key_index], nodes[key_index+1], remain_s)
75
75
  return longlat
76
76
  else:
77
77
  # 逆道路方向前进
78
- key_index = len(nodes)
78
+ if distance == 0:
79
+ return [nodes[-1]['x'], nodes[-1]['y']]
80
+ key_index = len(nodes)-1 # last node
79
81
  for i in range(len(nodes)-1, 0, -1):
80
82
  x1, y1 = nodes[i]['x'], nodes[i]['y']
81
83
  x2, y2 = nodes[i-1]['x'], nodes[i-1]['y']
@@ -85,7 +87,7 @@ def get_xy_in_lane(nodes, distance, direction:str='front'):
85
87
  break;
86
88
  key_index -= 1
87
89
  if remain_s < 0.5:
88
- return [nodes[0]['x'], nodes[0]['y']]
90
+ return [nodes[key_index]['x'], nodes[key_index]['y']]
89
91
  longlat = point_on_line_given_distance(nodes[key_index], nodes[key_index-1], remain_s)
90
92
  return longlat
91
93
 
@@ -407,7 +409,7 @@ class Sence(BrainFunction):
407
409
  x, y = get_xy_in_lane(nodes, neg_s, 'back')
408
410
  longlat = self._agent._simulator.map.xy2lnglat(x=x, y=y)
409
411
  type = self._lane_type_mapping.get(lane['type'], 'unspecified')
410
- positions += [{'lans_id': lane_id,
412
+ positions += [{'lane_id': lane_id,
411
413
  's': neg_s,
412
414
  'xy': (x, y),
413
415
  'longlat': longlat,
@@ -418,8 +420,8 @@ class Sence(BrainFunction):
418
420
  x, y = get_xy_in_lane(nodes, pos_s)
419
421
  longlat = self._agent._simulator.map.xy2lnglat(x=x, y=y)
420
422
  type = self._lane_type_mapping.get(lane['type'], 'unspecified')
421
- positions += [{'lans_id': lane_id,
422
- 's': neg_s,
423
+ positions += [{'lane_id': lane_id,
424
+ 's': pos_s,
423
425
  'xy': (x, y),
424
426
  'longlat': longlat,
425
427
  'type': type}]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pycityagent
3
- Version: 1.1.6
3
+ Version: 1.1.8
4
4
  Summary: LLM-based城市模拟器agent构建库
5
5
  Author-email: Yuwei Yan <pinkgranite86@gmail.com>
6
6
  License: MIT License
@@ -19,7 +19,7 @@ pycityagent/brain/brain.py,sha256=G1Q98qZ6MH1SquC3BubgJqVvIBY-Vf7elgo7zzPEGwI,10
19
19
  pycityagent/brain/brainfc.py,sha256=E1N9Kdjjmo7S_kgvv8pr_gFDbQvRmXxEn1BVn85hd1s,280
20
20
  pycityagent/brain/memory.py,sha256=UBZFeUYBnQ_03_QYgJhgdWRy4n5MnISopw8-Brk-sag,22067
21
21
  pycityagent/brain/scheduler.py,sha256=b8MRikIJn1meTiIYi0gb6C607QnlpQkNc-Q_E0K2_Ks,18593
22
- pycityagent/brain/sence.py,sha256=uFau9iNZFat_E982P5eoH5WkTbqHJgjj2A9ofUTnq08,28724
22
+ pycityagent/brain/sence.py,sha256=b6rwDjmKnfJQmdMtBmyVsLTVhWxEYuwHdMv4h7Zhlqc,28861
23
23
  pycityagent/brain/static.py,sha256=fdBjHKacNiDCKhvQkc9WgEYYSO0peMC5lb8CcXl9iNc,29101
24
24
  pycityagent/brain/persistence/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
25
  pycityagent/brain/persistence/social.py,sha256=6hJi14sFm4LOU1JlnX8Vq_jFv7VII1uHDM9lrt7-JDA,27
@@ -46,8 +46,8 @@ pycityagent/st/__init__.py,sha256=LN9UMUUI_tZKAW-cUHszpRA8MjP4KL3RM0YQJY1ugVs,10
46
46
  pycityagent/st/st.py,sha256=PxNsy_BEZng2mOETKCK0ira98p4LjGluM17W3QZ_9Xw,5210
47
47
  pycityagent/urbanllm/__init__.py,sha256=ew7bS1-jaRf_MDTkDxvTup9a9-9FLqL0SLoloxrNDkU,85
48
48
  pycityagent/urbanllm/urbanllm.py,sha256=MbDxCFxlJ-FP1o51Ig-LW3eE6qsbXW52YWuY5_x-hgA,5221
49
- pycityagent-1.1.6.dist-info/LICENSE,sha256=Yo9QmwLDFU3VoOc0W8aYSCa5Yj5sJyqM3FEcbC2jMQQ,1063
50
- pycityagent-1.1.6.dist-info/METADATA,sha256=b4tQSzEszfAoy4PtVmZn_yzEPrVJ-mCDHhfDGekvvnE,7768
51
- pycityagent-1.1.6.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
52
- pycityagent-1.1.6.dist-info/top_level.txt,sha256=mf70CsOn3eVJBwHQ_TjCesoc-elD0Bj2WLsi5APRjlU,12
53
- pycityagent-1.1.6.dist-info/RECORD,,
49
+ pycityagent-1.1.8.dist-info/LICENSE,sha256=Yo9QmwLDFU3VoOc0W8aYSCa5Yj5sJyqM3FEcbC2jMQQ,1063
50
+ pycityagent-1.1.8.dist-info/METADATA,sha256=K_RyISrFh88PULr1k_2Bk3wVAeSYR6qUt0JTJdYlvqM,7768
51
+ pycityagent-1.1.8.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
52
+ pycityagent-1.1.8.dist-info/top_level.txt,sha256=mf70CsOn3eVJBwHQ_TjCesoc-elD0Bj2WLsi5APRjlU,12
53
+ pycityagent-1.1.8.dist-info/RECORD,,