Skip to content

Commit

Permalink
Bug fix when assessing whether an agent is random or not
Browse files Browse the repository at this point in the history
  • Loading branch information
frangente committed Feb 7, 2024
1 parent 8816b3c commit f684e2b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/domain/beliefs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ interface AgentInfo {
id: AgentID;
random: boolean;
firstSeen: Instant;
firstScore: number;
}

export class BeliefSet {
Expand Down Expand Up @@ -418,14 +419,15 @@ export class BeliefSet {
const avgScore =
((visitedTiles / avgParcelsDistance) * parcelRewardMean) / numSmartAgents;

info.random = avgScore > agent.score;
info.random = avgScore > agent.score - info.firstScore;
} else {
// We did not know about the agent, so we add it to the set of agents.
// For now, we assume that the agent is not random.
const info: AgentInfo = {
id: agent.id,
random: false,
firstSeen: now,
firstScore: agent.score,
};
this._agents.set(agent.id, info);
}
Expand Down

0 comments on commit f684e2b

Please sign in to comment.