:py:mod:`starling_sim.basemodel.agent.persons.person` ===================================================== .. py:module:: starling_sim.basemodel.agent.persons.person Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: starling_sim.basemodel.agent.persons.person.Person .. py:class:: Person(simulation_model, agent_id, origin, destination, origin_time, number=1, **kwargs) Bases: :py:obj:`starling_sim.basemodel.agent.moving_agent.MovingAgent` This class describes the basic features of a human agent It should be extended to implement more specific features and behaviours .. py:attribute:: SCHEMA .. py:method:: __str__() Give a string display to the simulation element .. py:method:: trace_event(event) Add the event to the person's trace and to other relevant agents. In the case of a movement using a vehicle, the vehicle itself traces the movements of the agent. :param event: Event object to be added to the person's trace .. py:method:: move_shortest_with_vehicle_(destination=None, duration=None, parameters=None) Call self.vehicle's move method. :param destination: agent destination, default is self.tempDestination :param duration: total duration of the move :param parameters: agent specific parameters used for path evaluation :return: yield the moving process of the agent's vehicle .. py:method:: walk_to_destination_() Walk from current position to the destination position. :return: .. py:method:: get_vehicle(vehicle) Get the given vehicle. Set the agent's vehicle attribute, and add the agent to the vehicle occupants. This method should only be called after making sure the vehicle is available :param vehicle: Vehicle object .. py:method:: leave_vehicle() Leave the currently owned vehicle. Set the agent's vehicle attribute, and add the agent to the vehicle occupants. This method should only be called after making sure the owner is allowed to leave the vehicle. .. py:method:: closest_walkable_node_of(mode, position=None, n=1, parameters=None, return_path=False) Compute the closest node of the given mode that can be reached by walking. The node is computed by looking at the common nodes of the two modes. The default behaviour is then to look at the euclidean closest one (with n=1), but the shortest path can also be used. It can be returned with the result node. :param mode: mode that should be reached by walking :param position: departure position. Default is self.position. :param n: simplify the computation to the n euclidean closest nodes. Default is 1, we look at the euclidean closest node . :param parameters: agent parameters for computing weight :param return_path: boolean indicating if the path should be returned. Default is False. :return: closest_node, or (closest_node, path) if return_path .. py:method:: try_new_request_() Realise a new request according to the agent state. This method must be implemented according to the user's request mode :return: Request object, completed according to request result .. py:method:: request_loop_(max_tentatives=None) Loop over the requests and return the last one. This method allows the user to loop over a series of requests. The user either stop after succeeding in a request, or after reaching the maximum number of tentatives (which defaults to infinite). The creation and execution of new requests are realised by calling the try_new_request method, which must be implemented for the needs of the model. :param max_tentatives: number of failed requests until giving up :return: last Request object, completed according to request result .. py:method:: wait_for_request_(request, patience=None) Wait for the given request, respecting a patience threshold. :param request: Request object :param patience: patience threshold, None corresponds to infinite patience :return: yield the request event, with a timeout event if patience is provided, and returns the request result .. py:method:: wait_trip_request_(request) .. py:method:: station_get_request(local_station) Request (GET) the station at current position. :param local_station: Station object at current position :return: StationRequest object .. py:method:: station_put_request(local_station) Request (PUT) the station at current position. :param local_station: Station object at current position :return: StationRequest object