theRAPTLab / gsgo

GEM-STEP Foundation repo migrated from GitLab June 2023
1 stars 1 forks source link

Refactoring Canonical Agent Ids and Instance Definitions #33

Open benloh opened 3 years ago

benloh commented 3 years ago

In GitLab by @daveseah on Mar 17, 2021, 13:57

Note: Agents will be called Characters in the future. Just not in the current codebase yet.

Agents were considered the important data unit of simulation data, as each character is a bag of properties that are operated on by the simulation. For mapping agents one-to-one with derived data objects, each agent's id was copied to the new object. So, for an agent with id A123, a VisualObject is created with the same id A123. Likewise, the DisplayObject used in display lists share the same id. This pattern is used throughout STEP for any dataset that needs to be "synchronized" with the set of instantiated Characters.

As we get into the management of actual sets of instances in the model, it's becoming apparent that the important unit has changed. It's no longer the Characters in the simulation, but the definitions of those characters that are used to create them in the first place. Therefore, we need to move the canonical id code from the Agent class to something else. This code actually lives in the SMObject base class, which defines the common interface used for all the student-scriptable simulation objects and their properties.

WORKING NOTES

benloh commented 3 years ago

A few notes/reminders: