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.
How to edit the csv files in Google Sheets (Recommended)
Import the desired csv file by navigating to File > Import > Upload File in the header of a new Google Sheet file.
When prompted, designate where you would like to import the csv file. We recommend having a single Google Sheet file with 5 sheets (one for each csv file) for easy use and for easy collaboration with other researchers.
When you are done editing the csv files, you will need to download each csv sheet and replace the corresponding existing one in the project file directory /input
with your new one, ensuring the name of the file is still the same.
How to edit the csv files in Microsoft Excel
Import the desired csv file by navigating to Data > From text/CSV > Select File in the header.
When prompted on how to load the data, choose the follow values:
File Origin: 65001: Unicode (UTF-8)
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).
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!