Skip to contents

Selects the next speaker probabilistically based on propensities. Propensities decrease after speaking and recover over time.

Super class

FocusGroup::ConversationFlow -> ProbabilisticFlow

Public fields

propensities

Named numeric vector. Current speaking propensities for each agent.

base_propensities

Named numeric vector. Base propensities for each agent.

recovery_increment

Numeric. Factor by which propensities recover towards base.

Methods


Method new()

Initialize ProbabilisticFlow.

Usage

ProbabilisticFlow$new(
  agents,
  moderator_id,
  initial_propensities = NULL,
  recovery_increment = 0.1
)

Arguments

agents

A named list of `FGAgent` objects.

moderator_id

Character. The ID of the moderator agent.

initial_propensities

Named numeric vector. Optional. Base propensities for each participant. If `NULL`, defaults to 1.0 for all participants (moderator excluded). Names must match participant IDs.

recovery_increment

Numeric. Rate at which propensity recovers (0 to 1).


Method select_next_speaker()

Selects the next speaker based on current propensities.

Usage

ProbabilisticFlow$select_next_speaker(focus_group)

Arguments

focus_group

The `FocusGroup` object.

Returns

The selected `FGAgent`, or `NULL` if no eligible speaker.


Method update_state_post_selection()

Updates propensities after a speaker is selected.

Usage

ProbabilisticFlow$update_state_post_selection(speaker_id, focus_group)

Arguments

speaker_id

The ID of the agent who spoke.

focus_group

The `FocusGroup` object.


Method clone()

The objects of this class are cloneable with this method.

Usage

ProbabilisticFlow$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.