agentsociety.environment.sim.person_service

Module Contents

Classes

PersonService

交通模拟person服务 Traffic simulation person service

Functions

Data

API

agentsociety.environment.sim.person_service.__all__

[‘PersonService’]

agentsociety.environment.sim.person_service.default_person_template_generator() → pycityproto.city.person.v2.person_pb2.Person
class agentsociety.environment.sim.person_service.PersonService(aio_channel: grpc.aio.Channel)

交通模拟person服务 Traffic simulation person service

Initialization

static default_person(return_dict: bool = False) → Union[pycityproto.city.person.v2.person_pb2.Person, dict]

获取person基本模板 Get person basic template

需要补充的字段有person.home,person.schedules,person.labels The fields that need to be supplemented are person.home, person.schedules, person.labels

GetPerson(req: Union[pycityproto.city.person.v2.person_service_pb2.GetPersonRequest, dict[str, Any]], dict_return: bool = True) → collections.abc.Coroutine[Any, Any, Union[dict[str, Any], pycityproto.city.person.v2.person_service_pb2.GetPersonResponse]]

获取person信息 Get person information

AddPerson(req: Union[pycityproto.city.person.v2.person_service_pb2.AddPersonRequest, dict[str, Any]], dict_return: bool = True) → collections.abc.Coroutine[Any, Any, Union[dict[str, Any], pycityproto.city.person.v2.person_service_pb2.AddPersonResponse]]

新增person Add a new person

SetSchedule(req: Union[pycityproto.city.person.v2.person_service_pb2.SetScheduleRequest, dict[str, Any]], dict_return: bool = True) → collections.abc.Coroutine[Any, Any, Union[dict[str, Any], pycityproto.city.person.v2.person_service_pb2.SetScheduleResponse]]

修改person的schedule set person’s schedule

ResetPersonPosition(req: Union[pycityproto.city.person.v2.person_service_pb2.ResetPersonPositionRequest, dict[str, Any]], dict_return: bool = True) → collections.abc.Coroutine[Any, Any, Union[dict[str, Any], pycityproto.city.person.v2.person_service_pb2.ResetPersonPositionResponse]]

重置人的位置(将停止当前正在进行的出行,转为sleep状态) Reset person’s position (stop the current trip and switch to sleep status)

GetGlobalStatistics(req: Union[pycityproto.city.person.v2.person_service_pb2.GetGlobalStatisticsRequest, dict[str, Any]], dict_return: bool = True) → collections.abc.Coroutine[Any, Any, Union[dict[str, Any], pycityproto.city.person.v2.person_service_pb2.GetGlobalStatisticsResponse]]

获取全局统计信息 Get global statistics