Skip to content

Commit

Permalink
1. bugfix: sence; 2. 文档注释补充
Browse files Browse the repository at this point in the history
  • Loading branch information
PinkGranite committed Apr 13, 2024
1 parent b242dfd commit 5a7c04e
Show file tree
Hide file tree
Showing 31 changed files with 208 additions and 259 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ cache/
dist/
*egg-info/
__*
docs/
4 changes: 4 additions & 0 deletions pycityagent/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
"""
Pycityagent: 城市智能体构建框架
"""

from .simulator import Simulator
from .agent import Agent
from .agent_citizen import CitizenAgent
Expand Down
2 changes: 2 additions & 0 deletions pycityagent/ac/ac.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""命令控制器类及其定义"""

from typing import Any, Optional, Union
from .action import Action
from .citizen_actions.trip import TripAction
Expand Down
7 changes: 7 additions & 0 deletions pycityagent/ac/action.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Action类及其定义"""

from abc import ABC, abstractclassmethod
from typing import Callable, Any

Expand All @@ -15,6 +17,9 @@ class ActionType:
Hub = 2
Comp = 3
class Action:
"""
- Action
"""
def __init__(self, agent, type:ActionType, source: str = None, before:Callable[[list], Any] = None) -> None:
'''
默认初始化
Expand Down Expand Up @@ -47,9 +52,11 @@ async def Forward(self):
'''接口函数'''

class SimAction(Action):
"""SimAction: 模拟器关联Action"""
def __init__(self, agent, source: str = None, before: Callable[[list], Any] = None) -> None:
super().__init__(agent, ActionType.Sim, source, before)

class HubAction(Action):
"""HubAction: Apphub关联Action"""
def __init__(self, agent, source: str = None, before: Callable[[list], Any] = None) -> None:
super().__init__(agent, ActionType.Hub, source, before)
13 changes: 0 additions & 13 deletions pycityagent/ac/controled.py

This file was deleted.

31 changes: 0 additions & 31 deletions pycityagent/ac/converse.py

This file was deleted.

2 changes: 2 additions & 0 deletions pycityagent/ac/hub_actions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""AppHub关联Action定义"""

from typing import Callable, Optional, Any
from pycitysim.apphub import AgentMessage
from .action import HubAction
Expand Down
17 changes: 0 additions & 17 deletions pycityagent/ac/idle.py

This file was deleted.

80 changes: 0 additions & 80 deletions pycityagent/ac/shop.py

This file was deleted.

2 changes: 2 additions & 0 deletions pycityagent/ac/sim_actions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Simulator相关Action定义"""

import time
from typing import Callable, Optional, Any
from .action import SimAction
Expand Down
37 changes: 0 additions & 37 deletions pycityagent/ac/trip.py

This file was deleted.

Loading

0 comments on commit 5a7c04e

Please sign in to comment.