Skip to content

World Entity List Access

David Young edited this page Apr 30, 2025 · 1 revision

Description

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.

Assumptions

  • 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.

Limitations

  • 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 the World interface 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 Platform objects directly from the World. Platforms are typically accessed indirectly through the Transmitter, Receiver, or Target objects they are associated with via Object::getPlatform().

Related Components

  • World class (specifically the getTransmitters(), getReceivers(), getTargets() methods)
  • Transmitter, Receiver, Target classes (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 entity std::unique_ptrs within World.

Validation Status

  • 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 (likely const&) to the expected internal collections within the World instance.
    • 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.
  • Priority: Low (This is fundamental framework access, often implicitly tested by any end-to-end simulation test case).

Clone this wiki locally