`ConversationFlow` is an R6 base class defining the interface for turn-taking mechanisms in a focus group simulation. Subclasses implement specific strategies for selecting the next speaker.
Methods for Subclassing
- `initialize(agents, moderator_id)`
Sets up the flow. Call `super$initialize(agents, moderator_id)`.
- `select_next_speaker(focus_group)`
*Required*. Logic to choose the next `FGAgent` to speak. Should return the agent object or `NULL`.
- `update_state_post_selection(speaker_id, focus_group)`
Optional. Updates internal state after a speaker has spoken. Base implementation updates `self$last_speaker_id`.
Public fields
agentsA named list of `FGAgent` objects participating in the conversation.
agent_idsA character vector of agent identifiers (names of the `agents` list).
participant_idsA character vector of agent identifiers, excluding the moderator.
moderator_idCharacter. The ID of the moderator agent.
last_speaker_idThe ID of the agent who last spoke. Can be `NULL`.
Methods
Method new()
Initializes the ConversationFlow object.
Usage
ConversationFlow$new(agents, moderator_id)