pycityagent 2.0.0a55__cp39-cp39-macosx_11_0_arm64.whl → 2.0.0a57__cp39-cp39-macosx_11_0_arm64.whl
Sign up to get free protection for your applications and to get access to all the features.
- pycityagent/environment/simulator.py +8 -1
- pycityagent/simulation/agentgroup.py +1 -0
- pycityagent/simulation/simulation.py +15 -4
- {pycityagent-2.0.0a55.dist-info → pycityagent-2.0.0a57.dist-info}/METADATA +1 -1
- {pycityagent-2.0.0a55.dist-info → pycityagent-2.0.0a57.dist-info}/RECORD +9 -9
- {pycityagent-2.0.0a55.dist-info → pycityagent-2.0.0a57.dist-info}/LICENSE +0 -0
- {pycityagent-2.0.0a55.dist-info → pycityagent-2.0.0a57.dist-info}/WHEEL +0 -0
- {pycityagent-2.0.0a55.dist-info → pycityagent-2.0.0a57.dist-info}/entry_points.txt +0 -0
- {pycityagent-2.0.0a55.dist-info → pycityagent-2.0.0a57.dist-info}/top_level.txt +0 -0
@@ -52,6 +52,8 @@ class Simulator:
|
|
52
52
|
f.write(_map_pb.SerializeToString())
|
53
53
|
|
54
54
|
if "simulator" in config:
|
55
|
+
if config["simulator"] is None:
|
56
|
+
config["simulator"] = {}
|
55
57
|
if "server" not in config["simulator"]:
|
56
58
|
self._sim_env = sim_env = ControlSimEnv(
|
57
59
|
task_name=config["simulator"].get("task", "citysim"),
|
@@ -62,7 +64,7 @@ class Simulator:
|
|
62
64
|
min_step_time=config["simulator"].get("min_step_time", 1000),
|
63
65
|
sim_addr=config["simulator"].get("server", None),
|
64
66
|
)
|
65
|
-
|
67
|
+
self.server_addr = sim_env.sim_addr
|
66
68
|
# using local client
|
67
69
|
self._client = CityClient(sim_env.sim_addr, secure=False)
|
68
70
|
"""
|
@@ -70,8 +72,12 @@ class Simulator:
|
|
70
72
|
- grpc client of simulator
|
71
73
|
"""
|
72
74
|
else:
|
75
|
+
raise ValueError(
|
76
|
+
f"Passing Traffic Simulation address is not supported!"
|
77
|
+
)
|
73
78
|
self._client = CityClient(config["simulator"]["server"], secure=False)
|
74
79
|
else:
|
80
|
+
self.server_addr = None
|
75
81
|
logger.warning(
|
76
82
|
"No simulator config found, no simulator client will be used"
|
77
83
|
)
|
@@ -173,6 +179,7 @@ class Simulator:
|
|
173
179
|
return formatted_time
|
174
180
|
else:
|
175
181
|
return int(now["t"])
|
182
|
+
|
176
183
|
async def pause(self):
|
177
184
|
await self._client.pause_service.pause()
|
178
185
|
|
@@ -87,6 +87,7 @@ class AgentGroup:
|
|
87
87
|
logger.info(f"-----Creating Mlflow client in AgentGroup {self._uuid} ...")
|
88
88
|
self.mlflow_client = MlflowClient(
|
89
89
|
config=_mlflow_config,
|
90
|
+
experiment_uuid=self.exp_id, # type:ignore
|
90
91
|
mlflow_run_name=f"{exp_name}_{1000*int(time.time())}",
|
91
92
|
experiment_name=exp_name,
|
92
93
|
run_id=mlflow_run_id,
|
@@ -84,13 +84,24 @@ class AgentSimulation:
|
|
84
84
|
self.exp_name = exp_name
|
85
85
|
self._simulator = Simulator(config["simulator_request"])
|
86
86
|
if enable_economy:
|
87
|
-
self.
|
88
|
-
|
87
|
+
self._economy_addr = economy_addr = self._simulator.server_addr
|
88
|
+
if economy_addr is None:
|
89
|
+
raise ValueError(
|
90
|
+
f"`simulator` not provided in `simulator_request`, thus unable to activate economy!"
|
91
|
+
)
|
92
|
+
_req_dict: dict = self.config["simulator_request"]
|
89
93
|
if "economy" in _req_dict:
|
90
|
-
_req_dict["economy"]
|
94
|
+
if _req_dict["economy"] is None:
|
95
|
+
_req_dict["economy"] = {}
|
96
|
+
if "server" in _req_dict["economy"]:
|
97
|
+
raise ValueError(
|
98
|
+
f"Passing Economy Simulation address is not supported!"
|
99
|
+
)
|
100
|
+
else:
|
101
|
+
_req_dict["economy"]["server"] = economy_addr
|
91
102
|
else:
|
92
103
|
_req_dict["economy"] = {
|
93
|
-
"server":
|
104
|
+
"server": economy_addr,
|
94
105
|
}
|
95
106
|
self.agent_prefix = agent_prefix
|
96
107
|
self._groups: dict[str, AgentGroup] = {} # type:ignore
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: pycityagent
|
3
|
-
Version: 2.0.
|
3
|
+
Version: 2.0.0a57
|
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,9 +1,3 @@
|
|
1
|
-
pycityagent-2.0.0a55.dist-info/RECORD,,
|
2
|
-
pycityagent-2.0.0a55.dist-info/LICENSE,sha256=n2HPXiupinpyHMnIkbCf3OTYd3KMqbmldu1e7av0CAU,1084
|
3
|
-
pycityagent-2.0.0a55.dist-info/WHEEL,sha256=md3JO_ifs5j508p3TDNMgtQVtnQblpGEt_Wo4W56l8Y,107
|
4
|
-
pycityagent-2.0.0a55.dist-info/entry_points.txt,sha256=BZcne49AAIFv-hawxGnPbblea7X3MtAtoPyDX8L4OC4,132
|
5
|
-
pycityagent-2.0.0a55.dist-info/top_level.txt,sha256=yOmeu6cSXmiUtScu53a3s0p7BGtLMaV0aff83EHCTic,43
|
6
|
-
pycityagent-2.0.0a55.dist-info/METADATA,sha256=NI-t0FkdHsFWQ4aFpPz0i7Jg0qOS16AGo2IOiMwYG44,9110
|
7
1
|
pycityagent/pycityagent-sim,sha256=1Nu-QYC0AuZyVWciGNa2XkYsUntbwAS15Bo7l-y6eok,35449490
|
8
2
|
pycityagent/__init__.py,sha256=PUKWTXc-xdMG7px8oTNclodsILUgypANj2Z647sY63k,808
|
9
3
|
pycityagent/pycityagent-ui,sha256=cHZjqtrQ4Fh4qtRahFNCNbT2DNHLmUexiDAa-72Z3RQ,40333378
|
@@ -28,9 +22,9 @@ pycityagent/memory/utils.py,sha256=oJWLdPeJy_jcdKcDTo9JAH9kDZhqjoQhhv_zT9qWC0w,8
|
|
28
22
|
pycityagent/memory/const.py,sha256=6zpJPJXWoH9-yf4RARYYff586agCoud9BRn7sPERB1g,932
|
29
23
|
pycityagent/memory/faiss_query.py,sha256=V3rIw6d1_xcpNqZBbAYz3qfjVNE7NfJ7xOS5SibPtVU,13180
|
30
24
|
pycityagent/memory/state.py,sha256=TYItiyDtehMEQaSBN7PpNrnNxdDM5jGppr9R9Ufv3kA,5134
|
31
|
-
pycityagent/simulation/simulation.py,sha256=
|
25
|
+
pycityagent/simulation/simulation.py,sha256=XOhHYx4zvDv6zgPBagY9Ao109wSZPSbdCH-amsw2pHo,33441
|
32
26
|
pycityagent/simulation/__init__.py,sha256=P5czbcg2d8S0nbbnsQXFIhwzO4CennAhZM8OmKvAeYw,194
|
33
|
-
pycityagent/simulation/agentgroup.py,sha256=
|
27
|
+
pycityagent/simulation/agentgroup.py,sha256=UnWUQ3Ev4qDQCOasb-EN08aUQi4SWHmM6aNSdBc850Q,31693
|
34
28
|
pycityagent/simulation/storage/pg.py,sha256=xRshSOGttW-p0re0fNBOjOpb-nQ5msIE2LsdT79_E_Y,8425
|
35
29
|
pycityagent/message/message_interceptor.py,sha256=w8XTyZStQtMjILpeAX3VMhAWcYAuaxCgSMwXQU1OryM,8951
|
36
30
|
pycityagent/message/__init__.py,sha256=f5QH7DKPqEAMyfSlBMnl3uouOKlsoel909STlIe7nUk,276
|
@@ -53,7 +47,7 @@ pycityagent/workflow/prompt.py,sha256=6jI0Rq54JLv3-IXqZLYug62vse10wTI83xvf4ZX42n
|
|
53
47
|
pycityagent/workflow/block.py,sha256=4QufS8XnyP6SYp8g1gDODW-H0nAHA7lvivrPGUq1p-w,9922
|
54
48
|
pycityagent/workflow/trigger.py,sha256=Df-MOBEDWBbM-v0dFLQLXteLsipymT4n8vqexmK2GiQ,5643
|
55
49
|
pycityagent/environment/__init__.py,sha256=MyZBwsweDIHOKSX2iSZs748foNtaiyEcyg6sc747T2g,263
|
56
|
-
pycityagent/environment/simulator.py,sha256=
|
50
|
+
pycityagent/environment/simulator.py,sha256=d2meQZewFFSvUZa7BkgCHgOkhFf6G_TQyIz_QBFgDI0,12437
|
57
51
|
pycityagent/environment/message/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
58
52
|
pycityagent/environment/utils/port.py,sha256=3OM6kSUt3PxvDUOlgyiendBtETaWU8Mzk_8H0TzTmYg,295
|
59
53
|
pycityagent/environment/utils/grpc.py,sha256=6EJwKXXktIWb1NcUiJzIRmfrY0S03QAXXGcCDHqAT00,1998
|
@@ -103,3 +97,9 @@ pycityagent/cityagent/blocks/mobility_block.py,sha256=xWbARMfJ3-6fddrW3VOUKJrXfM
|
|
103
97
|
pycityagent/survey/models.py,sha256=YE50UUt5qJ0O_lIUsSY6XFCGUTkJVNu_L1gAhaCJ2fs,3546
|
104
98
|
pycityagent/survey/__init__.py,sha256=rxwou8U9KeFSP7rMzXtmtp2fVFZxK4Trzi-psx9LPIs,153
|
105
99
|
pycityagent/survey/manager.py,sha256=S5IkwTdelsdtZETChRcfCEczzwSrry_Fly9MY4s3rbk,1681
|
100
|
+
pycityagent-2.0.0a57.dist-info/RECORD,,
|
101
|
+
pycityagent-2.0.0a57.dist-info/LICENSE,sha256=n2HPXiupinpyHMnIkbCf3OTYd3KMqbmldu1e7av0CAU,1084
|
102
|
+
pycityagent-2.0.0a57.dist-info/WHEEL,sha256=md3JO_ifs5j508p3TDNMgtQVtnQblpGEt_Wo4W56l8Y,107
|
103
|
+
pycityagent-2.0.0a57.dist-info/entry_points.txt,sha256=BZcne49AAIFv-hawxGnPbblea7X3MtAtoPyDX8L4OC4,132
|
104
|
+
pycityagent-2.0.0a57.dist-info/top_level.txt,sha256=yOmeu6cSXmiUtScu53a3s0p7BGtLMaV0aff83EHCTic,43
|
105
|
+
pycityagent-2.0.0a57.dist-info/METADATA,sha256=yn1syqalcmvcSdrXMOmcXa7Cj3-IHDE4AIL20UvDaEs,9110
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|