pycityagent 2.0.0a69__cp312-cp312-macosx_11_0_arm64.whl → 2.0.0a71__cp312-cp312-macosx_11_0_arm64.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.
- pycityagent/environment/sim/sim_env.py +0 -4
- pycityagent/memory/memory.py +13 -5
- pycityagent/pycityagent-sim +0 -0
- pycityagent/simulation/agentgroup.py +8 -4
- pycityagent/simulation/simulation.py +3 -3
- {pycityagent-2.0.0a69.dist-info → pycityagent-2.0.0a71.dist-info}/METADATA +1 -1
- {pycityagent-2.0.0a69.dist-info → pycityagent-2.0.0a71.dist-info}/RECORD +11 -11
- {pycityagent-2.0.0a69.dist-info → pycityagent-2.0.0a71.dist-info}/LICENSE +0 -0
- {pycityagent-2.0.0a69.dist-info → pycityagent-2.0.0a71.dist-info}/WHEEL +0 -0
- {pycityagent-2.0.0a69.dist-info → pycityagent-2.0.0a71.dist-info}/entry_points.txt +0 -0
- {pycityagent-2.0.0a69.dist-info → pycityagent-2.0.0a71.dist-info}/top_level.txt +0 -0
@@ -67,10 +67,6 @@ class ControlSimEnv:
|
|
67
67
|
self._log_dir = log_dir
|
68
68
|
self._min_step_time = min_step_time
|
69
69
|
self._timeout = timeout
|
70
|
-
self.m = Map(pb_path=map_file)
|
71
|
-
"""
|
72
|
-
地图数据
|
73
|
-
"""
|
74
70
|
|
75
71
|
self._sim_config = _generate_yaml_config(map_file, start_step, total_step)
|
76
72
|
# sim
|
pycityagent/memory/memory.py
CHANGED
@@ -484,14 +484,22 @@ class StreamMemory:
|
|
484
484
|
for target_memory in target_memories:
|
485
485
|
target_memory.cognition_id = cognition_id
|
486
486
|
|
487
|
-
async def get_all(self) -> list[
|
487
|
+
async def get_all(self) -> list[dict]:
|
488
488
|
"""
|
489
|
-
Retrieve all stream memory nodes.
|
489
|
+
Retrieve all stream memory nodes as dictionaries.
|
490
490
|
|
491
491
|
- **Returns**:
|
492
|
-
- `list[
|
493
|
-
"""
|
494
|
-
return
|
492
|
+
- `list[dict]`: List of all memory nodes as dictionaries.
|
493
|
+
"""
|
494
|
+
return [{
|
495
|
+
"id": memory.id,
|
496
|
+
"cognition_id": memory.cognition_id,
|
497
|
+
"tag": memory.tag.value,
|
498
|
+
"location": memory.location,
|
499
|
+
"description": memory.description,
|
500
|
+
"day": memory.day,
|
501
|
+
"t": memory.t,
|
502
|
+
} for memory in self._memories]
|
495
503
|
|
496
504
|
|
497
505
|
class StatusMemory:
|
pycityagent/pycityagent-sim
CHANGED
Binary file
|
@@ -28,7 +28,6 @@ from ..utils import (DIALOG_SCHEMA, INSTITUTION_STATUS_SCHEMA, PROFILE_SCHEMA,
|
|
28
28
|
logger = logging.getLogger("pycityagent")
|
29
29
|
__all__ = ["AgentGroup"]
|
30
30
|
|
31
|
-
|
32
31
|
@ray.remote
|
33
32
|
class AgentGroup:
|
34
33
|
def __init__(
|
@@ -406,9 +405,14 @@ class AgentGroup:
|
|
406
405
|
results = {}
|
407
406
|
if target_agent_uuids is None:
|
408
407
|
target_agent_uuids = self.agent_uuids
|
409
|
-
|
410
|
-
|
411
|
-
|
408
|
+
if content == "stream_memory":
|
409
|
+
for agent in self.agents:
|
410
|
+
if agent._uuid in target_agent_uuids:
|
411
|
+
results[agent._uuid] = await agent.stream.get_all()
|
412
|
+
else:
|
413
|
+
for agent in self.agents:
|
414
|
+
if agent._uuid in target_agent_uuids:
|
415
|
+
results[agent._uuid] = await agent.status.get(content)
|
412
416
|
return results
|
413
417
|
|
414
418
|
async def update(self, target_agent_uuid: str, target_key: str, content: Any):
|
@@ -273,11 +273,11 @@ class AgentSimulation:
|
|
273
273
|
- workflow:
|
274
274
|
- list[Step]
|
275
275
|
- Step:
|
276
|
-
- type: str, "step", "run", "interview", "survey", "intervene", "pause", "resume"
|
276
|
+
- type: str, "step", "run", "interview", "survey", "intervene", "pause", "resume", "function"
|
277
277
|
- days: int if type is "run", else None
|
278
278
|
- times: int if type is "step", else None
|
279
279
|
- description: Optional[str], description of the step
|
280
|
-
- func: Optional[Callable[AgentSimulation, None]], only used when type is "interview", "survey"
|
280
|
+
- func: Optional[Callable[AgentSimulation, None]], only used when type is "interview", "survey", "intervene", "function"
|
281
281
|
- message_intercept
|
282
282
|
- mode: "point"|"edge"
|
283
283
|
- max_violation_time: Optional[int], default to 3. The maximum time for someone to send bad message before banned. Used only in `point` mode.
|
@@ -386,7 +386,7 @@ class AgentSimulation:
|
|
386
386
|
logger.info(
|
387
387
|
f"Running step: type: {step['type']} - description: {step.get('description', 'no description')}"
|
388
388
|
)
|
389
|
-
if step["type"] not in ["run", "step", "interview", "survey", "intervene"]:
|
389
|
+
if step["type"] not in ["run", "step", "interview", "survey", "intervene", "pause", "resume", "function"]:
|
390
390
|
raise ValueError(f"Invalid step type: {step['type']}")
|
391
391
|
if step["type"] == "run":
|
392
392
|
llm_log_list, mqtt_log_list, simulator_log_list = await simulation.run(step.get("days", 1))
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: pycityagent
|
3
|
-
Version: 2.0.
|
3
|
+
Version: 2.0.0a71
|
4
4
|
Summary: LLM-based city environment agent building library
|
5
5
|
Author-email: Yuwei Yan <pinkgranite86@gmail.com>, Junbo Yan <yanjb20thu@gmali.com>, Jun Zhang <zhangjun990222@gmali.com>
|
6
6
|
License: MIT License
|
@@ -1,4 +1,4 @@
|
|
1
|
-
pycityagent/pycityagent-sim,sha256=
|
1
|
+
pycityagent/pycityagent-sim,sha256=hVQtSEhdZ3lFxl5i6ubPuDSv31hke_W0V_6gP8CMxBs,35884466
|
2
2
|
pycityagent/__init__.py,sha256=PUKWTXc-xdMG7px8oTNclodsILUgypANj2Z647sY63k,808
|
3
3
|
pycityagent/pycityagent-ui,sha256=Ur95yZygIaZ5l_CDqP9394M5GQ66iV5PkcNPYFWqzvk,41225346
|
4
4
|
pycityagent/metrics/mlflow_client.py,sha256=-iyh4BPVnBkluhmfucUzibCUnBX2iftkz4tVJJVxwHw,6958
|
@@ -12,7 +12,7 @@ pycityagent/llm/__init__.py,sha256=iWs6FLgrbRVIiqOf4ILS89gkVCTvS7HFC3vG-MWuyko,2
|
|
12
12
|
pycityagent/llm/llm.py,sha256=DvrgrnrmR2JAQRVOvvRo3w4aD8M-qLAqVSD5pXZHr4M,19019
|
13
13
|
pycityagent/llm/embeddings.py,sha256=3610I-_scAy8HwRNpT8hVJpH9_8_pTLCPptqnzSq10o,11322
|
14
14
|
pycityagent/llm/utils.py,sha256=rSx_fp-_Gh0vZ-x2rqAUqnpS56BVTZ4ChfAMarB8S1A,195
|
15
|
-
pycityagent/memory/memory.py,sha256=
|
15
|
+
pycityagent/memory/memory.py,sha256=4vztwJ6dterLJxAWHkqawEBnYtvxp7VUAm0btsCLvic,45057
|
16
16
|
pycityagent/memory/profile.py,sha256=Z1shwFc6MqakorbiY6rGqVAgCJP4YTpDrqnMQZcYQno,5227
|
17
17
|
pycityagent/memory/__init__.py,sha256=NClJAXC4G6I8kFWkPEcU2lbVDfyrRb5HrrBHgCXrzOU,125
|
18
18
|
pycityagent/memory/memory_base.py,sha256=av_sbD62PZbJyM8E9wmVuqYqgsutghcO7nJdAxGpHi0,9784
|
@@ -21,9 +21,9 @@ pycityagent/memory/utils.py,sha256=oJWLdPeJy_jcdKcDTo9JAH9kDZhqjoQhhv_zT9qWC0w,8
|
|
21
21
|
pycityagent/memory/const.py,sha256=nFmjvt-8FEB0hc0glOH3lliqJhkhf3D_NKxWI0pf6TY,936
|
22
22
|
pycityagent/memory/faiss_query.py,sha256=KPeyzIjD0dzkxr-TlOeCiIlkdh1WAyyipCAXUEt97Lk,17350
|
23
23
|
pycityagent/memory/state.py,sha256=JFCBuK1AS-HqscvdGS9ATF9AUU8t29_2leDY_6iO2_4,5158
|
24
|
-
pycityagent/simulation/simulation.py,sha256=
|
24
|
+
pycityagent/simulation/simulation.py,sha256=K4u2tikxreRPyC4xAQQKgtlh-0wc9valjP6uvO6LTuE,47972
|
25
25
|
pycityagent/simulation/__init__.py,sha256=u1WpgwVxPboXWMxrUQKMXJNmTKQYAeCaqZv9HmSxESY,118
|
26
|
-
pycityagent/simulation/agentgroup.py,sha256=
|
26
|
+
pycityagent/simulation/agentgroup.py,sha256=iagtmxqBw7eyMCxYFU1SuLIHdoqkiBQV5qcE448QXpo,37068
|
27
27
|
pycityagent/simulation/storage/pg.py,sha256=xRshSOGttW-p0re0fNBOjOpb-nQ5msIE2LsdT79_E_Y,8425
|
28
28
|
pycityagent/message/message_interceptor.py,sha256=QWuTUqi1Cu214fhFs0f78tD2zflMnb6zEAGB4RutXxs,17736
|
29
29
|
pycityagent/message/__init__.py,sha256=f5QH7DKPqEAMyfSlBMnl3uouOKlsoel909STlIe7nUk,276
|
@@ -58,7 +58,7 @@ pycityagent/environment/utils/const.py,sha256=1LqxnYJ8FSmq37fN5kIFlWLwycEDzFa8SF
|
|
58
58
|
pycityagent/environment/sim/pause_service.py,sha256=UUTa4pTBOX_MGKki9QDgKId7scch0waAWF9xRVmNlAs,1701
|
59
59
|
pycityagent/environment/sim/person_service.py,sha256=T1pRi5jDcivSInX7iGZoHKYZmgO7_t5MYtLhU12_LC4,10793
|
60
60
|
pycityagent/environment/sim/aoi_service.py,sha256=bYVJDrOfDn8hgOORDU7PxMaT-fpqXA5Z0A080l2EPBc,1242
|
61
|
-
pycityagent/environment/sim/sim_env.py,sha256=
|
61
|
+
pycityagent/environment/sim/sim_env.py,sha256=7HO5thoWMPQU_eZU2MolTLRgdS_x7I6F7qqdCWYxJJU,4496
|
62
62
|
pycityagent/environment/sim/lane_service.py,sha256=bmf0zOWkxDzMEDlhTdHNRJRiTFGgzjbeqmex387gHZs,3964
|
63
63
|
pycityagent/environment/sim/client.py,sha256=x4REWPRFG_C2s0-CWz8MnYalD_esfu2pPHf_vpsCG78,2852
|
64
64
|
pycityagent/environment/sim/__init__.py,sha256=CyJc5Tey9MgzomZv0ynAcV0yaUlSE3bPbegYXar8wJc,601
|
@@ -89,9 +89,9 @@ pycityagent/cityagent/blocks/mobility_block.py,sha256=YmKhJW_srC6b6n_LvJujSO-eB-
|
|
89
89
|
pycityagent/survey/models.py,sha256=g3xni4GcA1Py3vlGt6z4ltutjgQ4G0uINYAM8vKRJAw,5225
|
90
90
|
pycityagent/survey/__init__.py,sha256=rxwou8U9KeFSP7rMzXtmtp2fVFZxK4Trzi-psx9LPIs,153
|
91
91
|
pycityagent/survey/manager.py,sha256=tHkdeq4lTfAHwvgf4-udsXri0z2l6E00rEbvwl7SqRs,3439
|
92
|
-
pycityagent-2.0.
|
93
|
-
pycityagent-2.0.
|
94
|
-
pycityagent-2.0.
|
95
|
-
pycityagent-2.0.
|
96
|
-
pycityagent-2.0.
|
97
|
-
pycityagent-2.0.
|
92
|
+
pycityagent-2.0.0a71.dist-info/RECORD,,
|
93
|
+
pycityagent-2.0.0a71.dist-info/LICENSE,sha256=n2HPXiupinpyHMnIkbCf3OTYd3KMqbmldu1e7av0CAU,1084
|
94
|
+
pycityagent-2.0.0a71.dist-info/WHEEL,sha256=VujM3ypTCyUW6hcTDdK2ej0ARVMxlU1Djlh_zWnDgqk,109
|
95
|
+
pycityagent-2.0.0a71.dist-info/entry_points.txt,sha256=BZcne49AAIFv-hawxGnPbblea7X3MtAtoPyDX8L4OC4,132
|
96
|
+
pycityagent-2.0.0a71.dist-info/top_level.txt,sha256=yOmeu6cSXmiUtScu53a3s0p7BGtLMaV0aff83EHCTic,43
|
97
|
+
pycityagent-2.0.0a71.dist-info/METADATA,sha256=_fzsl3HAFmBCT9RR8lJYhRfxfFIanoNp30WEROFPbWU,9110
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|