pycityagent 2.0.0a32__py3-none-any.whl → 2.0.0a33__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.
@@ -411,19 +411,12 @@ class AgentGroup:
411
411
  }
412
412
  _statuses_time_list.append((_status_dict, _date_time))
413
413
  else:
414
+ # institution
414
415
  for agent in self.agents:
415
416
  _date_time = datetime.now(timezone.utc)
416
- position = await agent.memory.get("position")
417
- x = position["xy_position"]["x"]
418
- y = position["xy_position"]["y"]
419
- lng, lat = self.projector(x, y, inverse=True)
420
- if "aoi_position" in position:
421
- parent_id = position["aoi_position"]["aoi_id"]
422
- elif "lane_position" in position:
423
- parent_id = position["lane_position"]["lane_id"]
424
- else:
425
- # BUG: 需要处理
426
- parent_id = -1
417
+ # ATTENTION: no valid position for an institution
418
+ lng, lat = -1, -1
419
+ parent_id = -1
427
420
  try:
428
421
  nominal_gdp = await agent.memory.get("nominal_gdp")
429
422
  except:
@@ -148,9 +148,9 @@ class Block:
148
148
  trigger: Optional[EventTrigger] = None,
149
149
  ):
150
150
  self.name = name
151
- self.llm = llm
152
- self.memory = memory
153
- self.simulator = simulator
151
+ self._llm = llm
152
+ self._memory = memory
153
+ self._simulator = simulator
154
154
  # 如果传入trigger,将block注入到trigger中并立即初始化
155
155
  if trigger is not None:
156
156
  trigger.block = self
@@ -163,3 +163,21 @@ class Block:
163
163
  To be overridden by specific block implementations.
164
164
  """
165
165
  raise NotImplementedError("Subclasses should implement this method")
166
+
167
+ @property
168
+ def llm(
169
+ self,
170
+ ) -> LLM:
171
+ return self._llm # type: ignore
172
+
173
+ @property
174
+ def memory(
175
+ self,
176
+ ) -> Memory:
177
+ return self._memory # type: ignore
178
+
179
+ @property
180
+ def simulator(
181
+ self,
182
+ ) -> Simulator:
183
+ return self._simulator # type: ignore
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pycityagent
3
- Version: 2.0.0a32
3
+ Version: 2.0.0a33
4
4
  Summary: LLM-based城市环境agent构建库
5
5
  License: MIT
6
6
  Author: Yuwei Yan
@@ -50,7 +50,7 @@ pycityagent/metrics/__init__.py,sha256=X08PaBbGVAd7_PRGLREXWxaqm7nS82WBQpD1zvQzc
50
50
  pycityagent/metrics/mlflow_client.py,sha256=g_tHxWkWTDijtbGL74-HmiYzWVKb1y8-w12QrY9jL30,4449
51
51
  pycityagent/metrics/utils/const.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
52
52
  pycityagent/simulation/__init__.py,sha256=P5czbcg2d8S0nbbnsQXFIhwzO4CennAhZM8OmKvAeYw,194
53
- pycityagent/simulation/agentgroup.py,sha256=ARqycTmVR8kLmLojhTqP6GU1JCjjnwQ_T5SOb5-Spew,24406
53
+ pycityagent/simulation/agentgroup.py,sha256=QwVbgqKYp42_wRS3K6C6E7Aq8cYBacabHmXIKRaxYyw,23955
54
54
  pycityagent/simulation/simulation.py,sha256=9kkdgXSEOAN8wiewVFyORksti4IdVNU0opObV6ZYa9k,23344
55
55
  pycityagent/simulation/storage/pg.py,sha256=qGrYzJIAzjv8-d3-cle0rY0AN6XB6MgnHkFLBoLmKWU,7251
56
56
  pycityagent/survey/__init__.py,sha256=rxwou8U9KeFSP7rMzXtmtp2fVFZxK4Trzi-psx9LPIs,153
@@ -66,10 +66,10 @@ pycityagent/utils/parsers/parser_base.py,sha256=KBKO4zLZPNdGjPAGqIus8LseZ8W3Tlt2
66
66
  pycityagent/utils/pg_query.py,sha256=h5158xcrxjUTR0nKwAaG1neFfTHPbN5guLmaXpC8yvs,1918
67
67
  pycityagent/utils/survey_util.py,sha256=Be9nptmu2JtesFNemPgORh_2GsN7rcDYGQS9Zfvc5OI,2169
68
68
  pycityagent/workflow/__init__.py,sha256=QNkUV-9mACMrR8c0cSKna2gC1mMZdxXbxWzjE-Uods0,621
69
- pycityagent/workflow/block.py,sha256=l-z9iJo9_USZQRyj4TLMfihK0-tnNDG0a6jVk9WhG0o,6048
69
+ pycityagent/workflow/block.py,sha256=DeDW6DtIlVS2M6xN_l3kNfGW0JxRAtiAugetc85WpC0,6369
70
70
  pycityagent/workflow/prompt.py,sha256=6jI0Rq54JLv3-IXqZLYug62vse10wTI83xvf4ZX42nk,2929
71
71
  pycityagent/workflow/tool.py,sha256=xADxhNgVsjNiMxlhdwn3xGUstFOkLEG8P67ez8VmwSI,8555
72
72
  pycityagent/workflow/trigger.py,sha256=Df-MOBEDWBbM-v0dFLQLXteLsipymT4n8vqexmK2GiQ,5643
73
- pycityagent-2.0.0a32.dist-info/METADATA,sha256=V94OUuB_US8D7UljUrG8MHFqx27PUDQ2qMIX_XYNJSg,8033
74
- pycityagent-2.0.0a32.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
75
- pycityagent-2.0.0a32.dist-info/RECORD,,
73
+ pycityagent-2.0.0a33.dist-info/METADATA,sha256=kOVL3RkRLWSJcBAG_6XpQAkv3nH2rAxxB-Z9tKMl-Uc,8033
74
+ pycityagent-2.0.0a33.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
75
+ pycityagent-2.0.0a33.dist-info/RECORD,,