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 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.
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!
The posts.csv
file defines the basic content of the simulation posts (such as the caption text, picture, actor, etc.). Simulation posts are associated with (the actor who creates the post). One row in the csv file corresponds to one post.
condition indicates which experimental condition this post should be displayed in. If this value is left blank, this post will be displayed in all experimental conditions. Otherwise, this post will be displayed only participants in the defined experimental condition. Ensure that the value here exactly matches one of the experimental conditions labels as defined in the .env
file variable EXP_CONDITIONS_NAMES
(see for more info).
condition indicates which experimental condition this comment should be displayed in. If this value is left blank, this comment will be displayed in all experimental conditions. Otherwise, this comment will be displayed only participants in the defined experimental condition. Ensure that the value here exactly matches one of the experimental conditions labels as defined in the .env
file variable EXP_CONDITIONS_NAMES
(see for more info).
condition indicates which experimental condition this notification should be displayed in. If this value is left blank, this notification will be displayed in all experimental conditions. Otherwise, this notification will be displayed only participants in the defined experimental condition. Ensure that the value here exactly matches one of the experimental conditions labels as defined in the .env
file variable EXP_CONDITIONS_NAMES
(see for more info).
condition indicates which experimental condition this notification should be displayed in. If this value is left blank, this notification will be displayed in all experimental conditions. Otherwise, this notification will be displayed only participants in the defined experimental condition. Ensure that the value here exactly matches one of the experimental conditions labels as defined in the .env
file variable EXP_CONDITIONS_NAMES
(see for more info).
Ensure that the MONGODB_URI
value in your .env
file is set to your database (See for instructions again. If you followed the instructions to installing Truman, this should already be set to the correct value.).