pycityagent 2.0.0a56__cp311-cp311-macosx_11_0_arm64.whl → 2.0.0a58__cp311-cp311-macosx_11_0_arm64.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -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,8 @@ 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
68
+ config["simulator"]["server"] = self.server_addr
66
69
  # using local client
67
70
  self._client = CityClient(sim_env.sim_addr, secure=False)
68
71
  """
@@ -70,11 +73,10 @@ class Simulator:
70
73
  - grpc client of simulator
71
74
  """
72
75
  else:
73
- raise ValueError(
74
- f"Passing Traffic Simulation address is not supported!"
75
- )
76
76
  self._client = CityClient(config["simulator"]["server"], secure=False)
77
+ self.server_addr = config["simulator"]["server"]
77
78
  else:
79
+ self.server_addr = None
78
80
  logger.warning(
79
81
  "No simulator config found, no simulator client will be used"
80
82
  )
@@ -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,
@@ -83,19 +83,28 @@ class AgentSimulation:
83
83
  self.config = config
84
84
  self.exp_name = exp_name
85
85
  self._simulator = Simulator(config["simulator_request"])
86
+ _simulator_config = config["simulator_request"].get("simulator", {})
87
+ if "server" in _simulator_config:
88
+ raise ValueError(f"Passing Traffic Simulation address is not supported!")
86
89
  if enable_economy:
87
- self._economy_env = self._simulator._sim_env
90
+ self._economy_addr = economy_addr = self._simulator.server_addr
91
+ if economy_addr is None:
92
+ raise ValueError(
93
+ f"`simulator` not provided in `simulator_request`, thus unable to activate economy!"
94
+ )
88
95
  _req_dict: dict = self.config["simulator_request"]
89
96
  if "economy" in _req_dict:
97
+ if _req_dict["economy"] is None:
98
+ _req_dict["economy"] = {}
90
99
  if "server" in _req_dict["economy"]:
91
100
  raise ValueError(
92
101
  f"Passing Economy Simulation address is not supported!"
93
102
  )
94
103
  else:
95
- _req_dict["economy"]["server"] = self._economy_env.sim_addr
104
+ _req_dict["economy"]["server"] = economy_addr
96
105
  else:
97
106
  _req_dict["economy"] = {
98
- "server": self._economy_env.sim_addr,
107
+ "server": economy_addr,
99
108
  }
100
109
  self.agent_prefix = agent_prefix
101
110
  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.0a56
3
+ Version: 2.0.0a58
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,3 +1,9 @@
1
+ pycityagent-2.0.0a58.dist-info/RECORD,,
2
+ pycityagent-2.0.0a58.dist-info/LICENSE,sha256=n2HPXiupinpyHMnIkbCf3OTYd3KMqbmldu1e7av0CAU,1084
3
+ pycityagent-2.0.0a58.dist-info/WHEEL,sha256=NW1RskY9zow1Y68W-gXg0oZyBRAugI1JHywIzAIai5o,109
4
+ pycityagent-2.0.0a58.dist-info/entry_points.txt,sha256=BZcne49AAIFv-hawxGnPbblea7X3MtAtoPyDX8L4OC4,132
5
+ pycityagent-2.0.0a58.dist-info/top_level.txt,sha256=yOmeu6cSXmiUtScu53a3s0p7BGtLMaV0aff83EHCTic,43
6
+ pycityagent-2.0.0a58.dist-info/METADATA,sha256=AUgPOiWxGpZ5A9LMIruA_h9B0S41Zu_Z_eCY1_Z23iE,9110
1
7
  pycityagent/pycityagent-sim,sha256=1Nu-QYC0AuZyVWciGNa2XkYsUntbwAS15Bo7l-y6eok,35449490
2
8
  pycityagent/__init__.py,sha256=PUKWTXc-xdMG7px8oTNclodsILUgypANj2Z647sY63k,808
3
9
  pycityagent/pycityagent-ui,sha256=cHZjqtrQ4Fh4qtRahFNCNbT2DNHLmUexiDAa-72Z3RQ,40333378
@@ -22,9 +28,9 @@ pycityagent/memory/utils.py,sha256=oJWLdPeJy_jcdKcDTo9JAH9kDZhqjoQhhv_zT9qWC0w,8
22
28
  pycityagent/memory/const.py,sha256=6zpJPJXWoH9-yf4RARYYff586agCoud9BRn7sPERB1g,932
23
29
  pycityagent/memory/faiss_query.py,sha256=V3rIw6d1_xcpNqZBbAYz3qfjVNE7NfJ7xOS5SibPtVU,13180
24
30
  pycityagent/memory/state.py,sha256=TYItiyDtehMEQaSBN7PpNrnNxdDM5jGppr9R9Ufv3kA,5134
25
- pycityagent/simulation/simulation.py,sha256=3wFJEiYSNGVnEMOgKBhp566M-jm1l-kwFKXau2QJFSQ,33161
31
+ pycityagent/simulation/simulation.py,sha256=RZvDC6QBHjbm4d4WVdBJICG-X7TOSiQ04elZQBJWbeo,33646
26
32
  pycityagent/simulation/__init__.py,sha256=P5czbcg2d8S0nbbnsQXFIhwzO4CennAhZM8OmKvAeYw,194
27
- pycityagent/simulation/agentgroup.py,sha256=ANTQA2OFQpuNZBz2VRhy60pTPUM1lXHFJLzFgK1SvxQ,31633
33
+ pycityagent/simulation/agentgroup.py,sha256=UnWUQ3Ev4qDQCOasb-EN08aUQi4SWHmM6aNSdBc850Q,31693
28
34
  pycityagent/simulation/storage/pg.py,sha256=xRshSOGttW-p0re0fNBOjOpb-nQ5msIE2LsdT79_E_Y,8425
29
35
  pycityagent/message/message_interceptor.py,sha256=w8XTyZStQtMjILpeAX3VMhAWcYAuaxCgSMwXQU1OryM,8951
30
36
  pycityagent/message/__init__.py,sha256=f5QH7DKPqEAMyfSlBMnl3uouOKlsoel909STlIe7nUk,276
@@ -47,7 +53,7 @@ pycityagent/workflow/prompt.py,sha256=6jI0Rq54JLv3-IXqZLYug62vse10wTI83xvf4ZX42n
47
53
  pycityagent/workflow/block.py,sha256=4QufS8XnyP6SYp8g1gDODW-H0nAHA7lvivrPGUq1p-w,9922
48
54
  pycityagent/workflow/trigger.py,sha256=Df-MOBEDWBbM-v0dFLQLXteLsipymT4n8vqexmK2GiQ,5643
49
55
  pycityagent/environment/__init__.py,sha256=MyZBwsweDIHOKSX2iSZs748foNtaiyEcyg6sc747T2g,263
50
- pycityagent/environment/simulator.py,sha256=yDh3oa2WfgYm4zhTNizlADhI4I1WyNcXfLh99ItqiSA,12265
56
+ pycityagent/environment/simulator.py,sha256=8imXFHhNxVhritO7YEZqM59x4VkKS8rc0Dwu6SHaREo,12439
51
57
  pycityagent/environment/message/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
52
58
  pycityagent/environment/utils/port.py,sha256=3OM6kSUt3PxvDUOlgyiendBtETaWU8Mzk_8H0TzTmYg,295
53
59
  pycityagent/environment/utils/grpc.py,sha256=6EJwKXXktIWb1NcUiJzIRmfrY0S03QAXXGcCDHqAT00,1998
@@ -97,9 +103,3 @@ pycityagent/cityagent/blocks/mobility_block.py,sha256=xWbARMfJ3-6fddrW3VOUKJrXfM
97
103
  pycityagent/survey/models.py,sha256=YE50UUt5qJ0O_lIUsSY6XFCGUTkJVNu_L1gAhaCJ2fs,3546
98
104
  pycityagent/survey/__init__.py,sha256=rxwou8U9KeFSP7rMzXtmtp2fVFZxK4Trzi-psx9LPIs,153
99
105
  pycityagent/survey/manager.py,sha256=S5IkwTdelsdtZETChRcfCEczzwSrry_Fly9MY4s3rbk,1681
100
- pycityagent-2.0.0a56.dist-info/RECORD,,
101
- pycityagent-2.0.0a56.dist-info/LICENSE,sha256=n2HPXiupinpyHMnIkbCf3OTYd3KMqbmldu1e7av0CAU,1084
102
- pycityagent-2.0.0a56.dist-info/WHEEL,sha256=NW1RskY9zow1Y68W-gXg0oZyBRAugI1JHywIzAIai5o,109
103
- pycityagent-2.0.0a56.dist-info/entry_points.txt,sha256=BZcne49AAIFv-hawxGnPbblea7X3MtAtoPyDX8L4OC4,132
104
- pycityagent-2.0.0a56.dist-info/top_level.txt,sha256=yOmeu6cSXmiUtScu53a3s0p7BGtLMaV0aff83EHCTic,43
105
- pycityagent-2.0.0a56.dist-info/METADATA,sha256=hkVVU9cbagWMuXsPQ8p6SjB1QjxMs4xILhudf6AMHn0,9110