Skip to content

Commit

Permalink
add comment explaining the purpose behind compareAgentTrees (#608)
Browse files Browse the repository at this point in the history
  • Loading branch information
interim17 authored Nov 4, 2024
1 parent 696f7bd commit 3dece87
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/util/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,14 @@ export const roundToTimeStepPrecision = (
return Math.round(input * multiplier) / multiplier;
};

/**
Compare two instaces of UIDisplayData to see if they have the same agents
and display states.
This data structure is used to store different color settings.
We don't want to ever try and apply the color settings from one trajectory
to another, even if by chance they shared the same file name, or other
metadata.
*/
export const compareAgentTrees = (a: UIDisplayData, b: UIDisplayData) => {
if (a.length !== b.length) {
return false;
Expand Down

0 comments on commit 3dece87

Please sign in to comment.