Skip to contents

This function constructs an events dataframe in the proper format for inputting to write_input_from_df. It constructs basic dataframes only. It is limited to two actors who must act in patterned ways and only perform one type of action throughout the interaction. This can be the optimal action as calculated by bayesact or interact or it can be an action from the behaviors dictionary. It is possible to simulate interaction in larger network structures and with more complex patterns of action. Dataframes created by this function may be useful as templates for creating the more complicated events files needed for this.

Usage

basic_event_df(
  n,
  actors,
  a1_action = "bayesact_optimal",
  a2_action = "bayesact_optimal",
  a1_emotion = "none",
  a2_emotion = "none",
  noise = "none",
  act_simultaneously = FALSE,
  perspective_shift = TRUE,
  switch_actor_after = 1
)

Arguments

n

numeric; number of turns

actors

string vector of length 2; names of agents a1 and a2

a1_action, a2_action

string; one of "bayesact_optimal", "interact_optimal", or an action from the dictionary. Default "bayesact_optimal".

a1_emotion, a2_emotion

string; one of "none", "bayesact_optimal", "interact_optimal", or a modifier from the modifier dictionary. Default "none".

noise

string vector listing all the places where noise is desired. Options are "none" (default), "a1_action", "a1_emotion", "a2_action", "a2_emotion"

act_simultaneously

logical; whether the actors should act at the same time. Default FALSE--in this case, they will instead take turns.

perspective_shift

logical; whether to switch which actor is the agent/client when the turn switches. If true (default), the "perspective" of bayesact is always from the agent's point of view. If false, the perspective is always from one actor's point of view.

switch_actor_after

numeric; how many actions each actor should take before switching. Default 1. If act_simultaneously is TRUE, this is ignored.

Value

dataframe listing events

Examples

basic_event_df(10, actors = c("Sally", "Reem"))
#>    agent agent_action agent_emotion object object_action object_emotion
#> 1  Sally            *                 Reem                             
#> 2   Reem            *                Sally                             
#> 3  Sally            *                 Reem                             
#> 4   Reem            *                Sally                             
#> 5  Sally            *                 Reem                             
#> 6   Reem            *                Sally                             
#> 7  Sally            *                 Reem                             
#> 8   Reem            *                Sally                             
#> 9  Sally            *                 Reem                             
#> 10  Reem            *                Sally                             
basic_event_df(2, actors = c("Jamal", "Sam"), a1_action = "greet", a2_action = "bayesact_optimal",
    noise = c("a1_action", "a2_action"))
#>   agent agent_action agent_emotion object object_action object_emotion
#> 1 Jamal       greet+                  Sam                             
#> 2   Sam           *+                Jamal                             
basic_event_df(7, actors = c("Sally", "Reem"),
    noise = c("a1_action", "a2_action"), perspective_shift = FALSE,
    switch_actor_after = 2)
#>   agent agent_action agent_emotion object object_action object_emotion
#> 1 Sally           *+                 Reem                             
#> 2 Sally           *+                 Reem                             
#> 3 Sally                              Reem            *+               
#> 4 Sally                              Reem            *+               
#> 5 Sally           *+                 Reem                             
#> 6 Sally           *+                 Reem                             
#> 7 Sally                              Reem            *+               
basic_event_df(4, actors = c("Jamal", "Sam"),
    a1_action = "greet", a2_action = "bayesact_optimal",
    a1_emotion = "excited", a2_emotion = "tired",
    noise = c("a1_action", "a2_action", "a1_emotion", "a2_emotion"))
#>   agent agent_action agent_emotion object object_action object_emotion
#> 1 Jamal       greet+      excited+    Sam                             
#> 2   Sam           *+        tired+  Jamal                             
#> 3 Jamal       greet+      excited+    Sam                             
#> 4   Sam           *+        tired+  Jamal