To store every relation a single person has (excluding immediate family) I added a new "contacts" variable. Each contact has a link with the person which owns a "strength" variable indicating how good the relationship is. A positive value represents a friendship and a negative value represents an enemy.
Currently new friends and enemies can only be acquired by a person if they are in the same occupation as them. This will be expanded to friends of friends, and friends of family members in the near future.
I wrote some pseudo code before I coded the procedure in Netlogo:
Right now the chance of getting a new friend or enemy is based on the value of the global variable "NEW-CONTACT-CHANCE". It is important I change this in the future to add more "character" to each person. Outgoing people would have a larger chance to make friends, introverts would have less of a chance and especially egotistically people could have a larger chance to make enemies.for each person in simulation {for each employee in occupation {if employee is not already a contact {set rand = random(100)if rand < NEW-CONTACT-CHANCE{set contacts fput employeecreate-link-with employee {set strength random(100) - random(100)}}}}}
Each new feature I add to this simulation the more I realise Netlogo isn't suited to this project. With so many links for everyone's contacts, the visual representation becomes useless. You can see all the turtles bunched up around their occupation:
Adding a strength variable to links has resulted in an unexpected side effect. I was only going to use this variable for relationships between people but I could also use to to show how much a single person likes their occupation.
Finally the strength value of the relationship will be used to adjust emotions of people. For instance if someone dies, that strength value will be subtracted from their happiness. Or if someone got fired from their job, that strength value could also be subtracted from their happiness. So if someone hated their job so much it had a negative strength value, it would actually make them happy to lose their job.

No comments:
Post a Comment