Simulation components
Last updated
Last updated
There are 3 primary components to a simulation:
Actors: Actors are the simulated users on the website that the participant believes are real.
Posts: These are the simulated posts that the simulated actors have "posted"/"made", which appear on the timeline/feed.
Notifications, or actors' simulated responses to a participant's behavior on the platform: These are simulated behaviors from actors in response to a research participant's behavior. For example: if a participant posts a picture, you may simulate other actors liking, viewing, or commenting on their post. This component of the simulation reinforces the realism of the platform and keeps the user engaged. Specifically, there are three types of actors' behaviors.
Liking a participant's post or comment (called: ‘like’)
Reading a participant's post or comment (called: ‘read’)
Commenting on a participant's post (called: ‘reply’)
These components are defined in the csv files found in the project file directory /input
.
Below is a breakdown of each csv, their columns, and a description of what simulation component the file defines.
Note: If you change any simulation content involving pictures (ex: actors' profile pictures or post pictures), you will need to change the CDN
value in the.env
file. See the row with variable nameCDN
in the table on the Additional simulation components page for more information.
After defining all the 3 components to the simulation using the 5 .csv files above, populate this information to the database so that the changes will be made to your simulation:
Ensure all of the above .csv files are located in the /input
folder with the right file name.
Ensure that the MONGODB_URI
value in your .env
file is set to your database (See here for instructions again. If you followed the instructions to installing Truman, this should already be set to the correct value.).
In your project directory in your terminal/ command prompt: enter node populate.js
.
This will connect to the MongoDB database you defined in the .env file and upload the simulation data found in the csv files in the ./input folder in the project directory to the MongoDB database you created.
You should see green and yellow lines printed in the console indicating the progress of the database population.
After it is complete, you have now completed populating your definitions for your simulation into the database! Run your project locally, visit the feed/timeline, and observe your changes!
Delimiter: Comma
Then click 'Load'. This will load the content of the csv files with emojis and other values.
When you save the file, save the file as a CSV UTF-8 (Comma delimited) *.csv file. To do this, go to File > Save As > Select CSV UTF-8 (Comma delimited) (*.csv).
The Truman template currently has 76 profile photos in the /profile_pictures
folder and more to choose from in the subfolder /profile_pictures/unused
.
The Truman template currently has about 280 photos in this folder and more to choose from in the subfolder /post_pictures/unused
.
62:31 will simulate the post to appear [62]hours and [31] minutes after the participant joined the website.
62:31 simulates the comment's posting time to be 62 hours and 31 minutes after the participant joined the website
When defining comments, ensure that comments always appear "after" a post is made, for continuity purposes. So for example, if a post is simulated to appear at 04:10 (4 hours and 10 minutes after a participant creates their account), all comments on this post should be simulated to appear after 04:10 (i.e. times after 04:10).
userReplyID is the id indicating which participant's reply the actor should perform the behavior on. (required field, mutually exclusive with with userPostID)
This is a numerical value, where 0 corresponds to the participant's first reply, 1 corresponds to the participant's second reply, and so on.
type ('read
' or 'like
') is the type of actor response to the participant's post or comment.
actor is the username of the actor who performs this response/behavior. This value must match a username value in /input/actors.csv
exactly.
Note: There is an actor called generic-joe
defined in the actors.csv
. You may use this actor for multiple 'read
' rows to indicate and signal many people have read their post, since this actor will not appear in the profile photos of the notification (see below).
time is the timestamp the behavior should be simulated to happen. This timestamp is defined in reference to when the participant made the post or comment. Therefore, it is always positive, using the format (+)HH:MM. (required field)
For example:
00:04 (and userPost is 0
, and type is 'like'
) simulates the actor to read the participant's first post 4 minutes after it has been posted.