Simulation components
Simulation Components
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’)
How to define the simulation components
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.
Populate your database with your simulation
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!
Last updated