usersimcrs.simulation_platform¶
Simulation platform to connect simulator and agent.
Classes¶
Initializes the simulation platform. |
Module Contents¶
- class usersimcrs.simulation_platform.SimulationPlatform(agent_class: Type[dialoguekit.participant.Agent], agent_config: Dict[str, Any] = {})¶
Bases:
dialoguekit.platforms.Platform
Initializes the simulation platform.
- Parameters:
agent_class – Agent class.
agent_config – Configuration of the agent. Defaults to empty dictionary.
- start() None ¶
Starts the simulation platform.
It creates the agent.
- Raises:
RuntimeError – If the connection to the agent is refused.
ValueError – If the agent URI is not specified in the agent configuration.
- connect(user_id: str, simulator_class: Type[usersimcrs.simulator.user_simulator.UserSimulator], simulator_config: Dict[str, Any] = {}) None ¶
Connects a user simulator to an agent.
- Parameters:
user_id – User ID.
simulator_class – User simulator class.
simulator_config – Configuration of the user simulator. Defaults to empty dictionary.
- Raises:
Exception – If an error occurs during the dialogue.
- display_agent_utterance(agent_id: str, utterance: dialoguekit.core.Utterance) None ¶
Displays an agent utterance.
- Parameters:
agent_id – Agent ID.
utterance – An instance of Utterance.
- display_user_utterance(user_id: str, utterance: dialoguekit.core.Utterance) None ¶
Displays a user utterance.
- Parameters:
user_id – User ID.
utterance – An instance of Utterance.