forked from stpaine/FERS
-
Notifications
You must be signed in to change notification settings - Fork 1
World Entity List Access
David Young edited this page Apr 30, 2025
·
1 revision
Provides read-only methods (getTransmitters(), getReceivers(), getTargets()) allowing other parts of the simulation, primarily the core simulation loop and concurrency management (sim_threading), to retrieve references to the collections of Transmitter, Receiver, and Target objects currently managed within the World.
- Assumes the caller (e.g., the simulation loop logic) utilizes the retrieved lists correctly, typically by iterating through them to simulate interactions between pairs of entities (Tx-Rx, Tx-Target-Rx).
- Assumes that read-only (
const) access to these lists is sufficient for the operations performed by the callers during the main simulation computation phase.
-
Bulk Access Only: The interface provides access to the entire collection (e.g., a
std::vector) of Transmitters, Receivers, or Targets. There are no methods on theWorldinterface to directly retrieve a specific entity by its index, name, or other identifier; callers must iterate through the returned list if specific lookup is needed. -
No Direct Platform List Access: There is no public getter method provided to access the list of
Platformobjects directly from theWorld. Platforms are typically accessed indirectly through theTransmitter,Receiver, orTargetobjects they are associated with viaObject::getPlatform().
-
Worldclass (specifically thegetTransmitters(),getReceivers(),getTargets()methods) -
Transmitter,Receiver,Targetclasses (the types of objects stored in the lists) - Simulation loop / Concurrency logic (e.g.,
sim_threading, the primary user of these accessors) - Internal container classes (e.g.,
std::vector) holding the entitystd::unique_ptrs withinWorld.
- Needs Verification: Basic functional checks are needed to ensure the correct collections are returned and access constraints are met.
-
Key Areas for Validation:
- Verify that
getTransmitters(),getReceivers(),getTargets()return valid references (likelyconst&) to the expected internal collections within theWorldinstance. - Confirm that the access provided prevents callers from modifying the lists themselves (e.g., adding/removing elements) through the returned reference.
- Ensure that all entities added during the setup phase (e.g., via
World::addTransmitter) are present and accessible in the lists returned by these methods just before the simulation loop begins.
- Verify that
- Priority: Low (This is fundamental framework access, often implicitly tested by any end-to-end simulation test case).