Skip to content

BSc

Social Game System

A four-person Java simulation where agents with moods, inherited character traits and private vocabularies talk, befriend, reproduce and die, and where optimists take over until a performance fix causes a population crash.

Sept 2021Distributed systems

Built with Lorenzo Camilli, Gaetano Conti and Matteo Dispoto for a Java programming-methodologies course: a society of agents, each with a mood, one of eight character traits, and a private vocabulary that maps numbers to meanings. They meet, exchange messages, interpret them through their own vocabulary, gain or lose mood, have children, and die.

Context
Metodologie di Programmazione, Sapienza · team of four
Model
8 traits · mood 0–100 · 11-word private vocabulary
Reference run
100 agents, 1,000 days
Repository
VincenzoImp/social-game-system
VincenzoImp/social-game-systemAgent-based simulation of social dynamics in Java, with live population and mood charts.Java

What it was

The rule that makes it interesting is inheritance. A child receives its parent’s entire vocabulary and output dictionary, so the mapping from a number to a meaning passes down a lineage. Two agents can exchange the same message and one is cheered by it while the other is insulted, and that disagreement is heritable rather than random.

Each day, sixty per cent of the population attempts a new friendship, formed only if both sides independently agree. Friendships are re-weighted every five exchanges and can break. Mood above a hundred produces a child; mood at zero, or a predetermined death day, ends the agent.

What I took from it

Two things the simulation did that nobody designed.

Optimists win. Over long runs the positive trait dominates the population, because good moods produce children and children inherit the trait disproportionately, while the negative trait tends to die alone, its agents losing mood in isolation.

And then the fix became the finding. Tens of thousands of agents made each iteration crawl, so we added an overpopulation rule: above a threshold, lifespans shorten and families are capped. That was a performance workaround. What it produced was a population curve that climbs and then falls off a cliff: a boom and bust that came out of a decision made for entirely unrelated reasons. It is the clearest lesson in the project, and none of it was intended.