-
Notifications
You must be signed in to change notification settings - Fork 1
π€ Simulation
File: Meesterproef-SNSimulation/js/Person.js
The person class has a couple of functions where this.step is one of them. node.step() fires a couple of functions to simulate like they have their own behavior.
The functions that the step() fires will be explained a little bit more right here.
step(nodes, links) {
this.readSocialMediaPost(nodes, links);
this.forwardSocialMediaPost(links);
this.manageRelationships(links);
this.addFriendThroughContent(links);
this.moveNode(links);
}The step function gets fired for every single person node in the network. The step fires a couple of functions to let the person execute their own behaviour. All nodes do the same, but in some places, the social score plays a crucial role that decides if the person executes that action or not.
- A person reads one social media post from the network.
- If they like a post (this is based on the
acceptanceDistanceinPerson.js, if this is a high number, the node will like more posts), they forward the post to all the friends they have (this is based on the social score. The higher the social score, the higher the chances that the person sends the post). - If the post is sent to the friends, all the friends receive a post in the
receiveSocialMediaPostfunction. With some calculations, the score between the friend and the post is decided. This affects the relationship between the friend and the sender. - After that, the function for managing relationships with friends and info links is fired. This function looks at the score of the friendships and decides if it upgrades them to info links or breaks the friendship.
- Next, the person looks for new friends to make. It looks in their positive posts for readers who also liked that post. If the node finds one, they become friends (this is also based on the social score. If the social score is higher, the higher the chances are that they become friends).
- In the end, the node moves to their liked posts, info links, and friends. How fast it moves is based on the
stepDistance.
The paramters of the step() are nodes and links:
The nodes map consists of persons and posts and the links map contain all edges. The difference between persons and posts is the type, but also other data is stored in that node.
Person and post nodes are stored in nodes and link nodes are stored in links in the app.js, and look like this:
map:
key() = // id of the node
values() = // whole node
In a person node you can find other maps like friends, items and infoLinks. And in a post node you can find the map readers for example. In both nodes, the same principal is used but the values() look a little different.
map:
key() = // id of the node
values() = {
person: // the whole node,
score: // the score of the relationship or if they liked a post or not
}
-
π Debrief
-
β οΈ Problem definition -
π§βπ¨ Design
-
π§βπ» Solution & Code
- ποΈ App (main file)
- π€ Simulation
- π΅ Node
- π Person
- π° Post
- γ°οΈ Edge
βοΈ Cursor- π½ userData
- π WebData
- π Import & Export (FileHandler)
- Onboarding
-
π€ Recommendations