A Sims-like agent-based simulation non-game in Unity

wherein I learn a bunch of different things.

BACK

July 17, 2024

Weighted decision making

Previously I explored a basic framework whereby objects in the world were associated by concepts, which allow agents to search for and “learn” about their environment. I've extended that to allow our agent to pick between multiple food sources given a set of weighted criteria (e.g. distance, desirability, availability). There are two food sources in these scenarios: a pot of stew which has limited food, and a fish trap which replenishes itself periodically. Our agent prefers the pot to the fish trap.

Under different conditions, they makes different decisions while attempting to look for food.

Our agent attempts to eat from the pot first in the first three attempts despite it being farther away, but finally chooses the fish trap first as its availability outweighs its desirability.

The fish trap replenishes less often. After failing to find another source of food, on their second attempt, under the effects of starvation, our agent values distance and availability over desirability and chooses the fish trap first.

I can also spawn fish around the environment and they will evaluate them in the same manner as other food sources, and remember them the next time they are hungry.

Now our agent reacts dynamically to their environment with what I'd consider a reasonable degree of robustness.

Until next time.