pycityagent 1.1.0__py3-none-any.whl → 1.1.1__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.
@@ -297,7 +297,8 @@ class Sence(BrainFunction):
297
297
  - List[dict]: 可达位置列表
298
298
  - lane_id (int)
299
299
  - s (float)
300
- - longlat (Tuple[float, float]): [longitude, latitude]
300
+ - xy (Tuple[float, float]): (x, y)
301
+ - longlat (Tuple[float, float]): (longitude, latitude)
301
302
  - type (str): 'driving' / 'walking' / 'unspecified'
302
303
  '''
303
304
  radius_ = self._sence_radius
@@ -318,6 +319,7 @@ class Sence(BrainFunction):
318
319
  positions.append({
319
320
  'lane_id': driving_positions[i]['lane_id'],
320
321
  's': driving_positions[i]['s'],
322
+ 'xy': (driving_gates[i]['x'], driving_gates[i]['y']),
321
323
  'longlat': longlat,
322
324
  'type': 'driving'
323
325
  })
@@ -326,6 +328,7 @@ class Sence(BrainFunction):
326
328
  positions.append({
327
329
  'lane_id': walking_positions[i]['lane_id'],
328
330
  's': walking_positions[i]['s'],
331
+ 'xy': (walking_gates[i]['x'], walking_gates[i]['y']),
329
332
  'longlat': longlat,
330
333
  'type': 'walking'
331
334
  })
@@ -343,7 +346,11 @@ class Sence(BrainFunction):
343
346
  x, y = get_xy_in_lane(nodes, tmp_s)
344
347
  longlat = self._agent._simulator.map.xy2lnglat(x=x, y=y)
345
348
  type = copy.deepcopy(self._lane_type_mapping.get(lane['type'], 'unspecified'))
346
- positions += [{'lane_id': lane_id, 's': tmp_s, 'longlat': longlat, 'type': type}]
349
+ positions += [{'lane_id': lane_id,
350
+ 's': tmp_s,
351
+ 'xy': (x, y),
352
+ 'longlat': longlat,
353
+ 'type': type}]
347
354
 
348
355
  # 2. 前驱道路
349
356
  pre_lanes = lane['predecessors']
@@ -356,7 +363,11 @@ class Sence(BrainFunction):
356
363
  x, y = get_xy_in_lane(pre_lane_nodes, tmp_s, 'back')
357
364
  longlat = self._agent._simulator.map.xy2lnglat(x=x, y=y)
358
365
  type = self._lane_type_mapping.get(pre_lane_['type'], 'unspecified')
359
- positions += [{'lane_id': pre_lane_id, 's': tmp_s, 'longlat': longlat, 'type': type}]
366
+ positions += [{'lane_id': pre_lane_id,
367
+ 's': tmp_s,
368
+ 'xy': (x, y),
369
+ 'longlat': longlat,
370
+ 'type': type}]
360
371
  elif agent_s == lane['length']:
361
372
  # 处于当前道路的尾部端点位置
362
373
  # 1. 当前道路
@@ -365,7 +376,11 @@ class Sence(BrainFunction):
365
376
  x, y = get_xy_in_lane(nodes, tmp_s, 'back')
366
377
  longlat = self._agent._simulator.map.xy2loglat(x=x, y=y)
367
378
  type = self._lane_type_mapping.get(lane['type'], 'unspecified')
368
- positions += [{'lane_id': lane_id, 's': tmp_s, 'longlat': longlat, 'type': type}]
379
+ positions += [{'lane_id': lane_id,
380
+ 's': tmp_s,
381
+ 'xy': (x, y),
382
+ 'longlat': longlat,
383
+ 'type': type}]
369
384
 
370
385
  # 2. 后继道路
371
386
  suc_lanes = lane['successors']
@@ -378,7 +393,11 @@ class Sence(BrainFunction):
378
393
  x, y = get_xy_in_lane(suc_lane_nodes, tmp_s)
379
394
  longlat = self._agent._simulator.map.xy2loglat(x=x, y=y)
380
395
  type = self._lane_type_mapping.get(lane['type'], 'unspecified')
381
- positions += [{'lane_id': suc_lane_id, 's': tmp_s, 'longlat': longlat, 'type': type}]
396
+ positions += [{'lane_id': suc_lane_id,
397
+ 's': tmp_s,
398
+ 'xy': (x, y),
399
+ 'longlat': longlat,
400
+ 'type': type}]
382
401
  else:
383
402
  # 非端点位置
384
403
  neg_s = agent_s - radius_
@@ -386,14 +405,22 @@ class Sence(BrainFunction):
386
405
  x, y = get_xy_in_lane(nodes, neg_s, 'back')
387
406
  longlat = self._agent._simulator.map.xy2loglat(x=x, y=y)
388
407
  type = self._lane_type_mapping.get(lane['type'], 'unspecified')
389
- positions += [{'lans_id': lane_id, 's': neg_s, 'longlat': longlat, 'type': type}]
408
+ positions += [{'lans_id': lane_id,
409
+ 's': neg_s,
410
+ 'xy': (x, y),
411
+ 'longlat': longlat,
412
+ 'type': type}]
390
413
 
391
414
  pos_s = agent_s + radius_
392
415
  pos_s = pos_s if pos_s <= lane['length'] else lane['length']
393
416
  x, y = get_xy_in_lane(nodes, pos_s)
394
417
  longlat = self._agent._simulator.map.xy2loglat(x=x, y=y)
395
418
  type = self._lane_type_mapping.get(lane['type'], 'unspecified')
396
- positions += [{'lans_id': lane_id, 's': neg_s, 'longlat': longlat, 'type': type}]
419
+ positions += [{'lans_id': lane_id,
420
+ 's': neg_s,
421
+ 'xy': (x, y),
422
+ 'longlat': longlat,
423
+ 'type': type}]
397
424
  return positions
398
425
 
399
426
  async def PerceivePoi(self, radius:int=None, category:str=None):
@@ -82,7 +82,7 @@ class UrbanLLM:
82
82
  """
83
83
  ppt = "如何理解这幅图像?"
84
84
  if prompt != None:
85
- ppt += prompt
85
+ ppt = prompt
86
86
  dialog = [{
87
87
  'role': 'user',
88
88
  'content': [
@@ -101,7 +101,7 @@ class UrbanLLM:
101
101
  print(response.code) # The error code.
102
102
  return "Error"
103
103
 
104
- def img_generate(self, prompt, size:str='512*512', quantity:int = 1):
104
+ def img_generate(self, prompt:str, size:str='512*512', quantity:int = 1):
105
105
  """
106
106
  图像生成
107
107
  Image generation
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pycityagent
3
- Version: 1.1.0
3
+ Version: 1.1.1
4
4
  Summary: LLM-based城市模拟器agent构建库
5
5
  Author-email: Yuwei Yan <pinkgranite86@gmail.com>
6
6
  License: MIT License
@@ -60,7 +60,7 @@ Requires-Dist: transitions >=0.9.0
60
60
  - ![framwork](./static/framework.png)
61
61
 
62
62
  ### Workflow of CityAgent
63
- - ![workflow](./static/workflow.png)
63
+ - ![workflow](./static/workflow_1.png)
64
64
 
65
65
  ## Hands On - By An Easy Demo
66
66
  ### Apply for your App
@@ -24,7 +24,7 @@ pycityagent/brain/brain.py,sha256=WlIcp79ZbiWL47ubdVeXtUvQmzb0Rzluwq3tT2LjHBo,10
24
24
  pycityagent/brain/brainfc.py,sha256=XoiNUQgP4P7ui9dRZWTfzyzBVTDYZf10XqM7kot0Dbg,252
25
25
  pycityagent/brain/memory.py,sha256=MhTO8qzhogi-vA12eN3Y3H8gdflYf01XQmIM92N-RaI,21934
26
26
  pycityagent/brain/scheduler.py,sha256=56T78XrIdZb7qdlKPkNB-ibKH36ooEqHyHcp2jlID90,18492
27
- pycityagent/brain/sence.py,sha256=w_K5URVDy48Hh9wS4stoE7mH2ZWV5H5Ske1GkYf7CeA,27610
27
+ pycityagent/brain/sence.py,sha256=taHdFT1o6ckK36WLOkyFMdRh72EJHkeBtb90cL4S6Mw,28683
28
28
  pycityagent/brain/static.py,sha256=vvPaJGKqTBqNe_N3LTFdDjgjjdeZb5niFrYUhGBsGD4,29081
29
29
  pycityagent/brain/persistence/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
30
  pycityagent/brain/persistence/social.py,sha256=6hJi14sFm4LOU1JlnX8Vq_jFv7VII1uHDM9lrt7-JDA,27
@@ -50,9 +50,9 @@ pycityagent/image/image.py,sha256=KyOBoX8I1KSi82lBCBku-NXgXX4gIFHi2cGEe7yQ-lI,53
50
50
  pycityagent/st/__init__.py,sha256=YzsQXrgqRvmoQ4dWqAztAriKd8wvnQVe0FOpX_oZmiY,109
51
51
  pycityagent/st/st.py,sha256=z6yDo7ADOjostLg0mLmQ0oa_VysaCXFm4MnzC2H9nsI,5154
52
52
  pycityagent/urbanllm/__init__.py,sha256=D24mYFXdIEL2vbvB7Cp_BGgJvg-tvEnCgtEAAGaqGDY,56
53
- pycityagent/urbanllm/urbanllm.py,sha256=XEmU4fpdxA7zZlSfdXnXd9SIsPF0eC1SjxPKHAjxuAE,4341
54
- pycityagent-1.1.0.dist-info/LICENSE,sha256=Yo9QmwLDFU3VoOc0W8aYSCa5Yj5sJyqM3FEcbC2jMQQ,1063
55
- pycityagent-1.1.0.dist-info/METADATA,sha256=3OfZWBCVFmVhtdme8hQnZhNz_0I33PZtjtQKDp3WwB4,7458
56
- pycityagent-1.1.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
57
- pycityagent-1.1.0.dist-info/top_level.txt,sha256=mf70CsOn3eVJBwHQ_TjCesoc-elD0Bj2WLsi5APRjlU,12
58
- pycityagent-1.1.0.dist-info/RECORD,,
53
+ pycityagent/urbanllm/urbanllm.py,sha256=6PHRNSlYHrbHyzC_Pv2An71S7hkm-6XmAN7pJTozwas,4344
54
+ pycityagent-1.1.1.dist-info/LICENSE,sha256=Yo9QmwLDFU3VoOc0W8aYSCa5Yj5sJyqM3FEcbC2jMQQ,1063
55
+ pycityagent-1.1.1.dist-info/METADATA,sha256=mauUBRmAFcENHHhwi8FZ7f8n03ZnZAtdfk8M88YmGiE,7460
56
+ pycityagent-1.1.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
57
+ pycityagent-1.1.1.dist-info/top_level.txt,sha256=mf70CsOn3eVJBwHQ_TjCesoc-elD0Bj2WLsi5APRjlU,12
58
+ pycityagent-1.1.1.dist-info/RECORD,,