Skip to content

World Entity Management

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

Description

This capability describes how the World class manages the primary actors or entities within the simulation. It acts as a central container, storing collections of Platform, Transmitter, Receiver, and Target objects. These entities are typically added to the World during the simulation setup phase, based on the configuration provided (e.g., parsed from an XML scenario file).

Assumptions

  • Assumes entities are added to the World via std::unique_ptr, transferring ownership to the World container.
  • Assumes entities are added before the main simulation loop begins.
  • Assumes the order in which entities are added generally does not impact the simulation logic, unless subsequent processing explicitly relies on the iteration order of the retrieved lists.
  • Assumes these core entity collections remain constant (no additions, removals, or modifications) after the initial setup phase is complete, with the notable exception of entities added during multipath initialization.

Limitations

  • Static Entity Collection: Once the initial setup (and potential multipath initialization) is complete, there are no public methods provided by the World class to dynamically add, remove, modify, or query individual entities (e.g., find a specific Target by name). Access is typically limited to retrieving the entire list of a given entity type.
  • Container Role: The World primarily serves as a static container for these entities during the main simulation run, facilitating access for simulation loops but not active management.

Related Components

  • Classes: World, Platform, Transmitter, Receiver, Target
  • Methods: World::add(std::unique_ptr<Platform>), World::add(std::unique_ptr<Transmitter>), World::add(std::unique_ptr<Receiver>), World::add(std::unique_ptr<Target>)
  • Internal Data: World::_platforms, World::_transmitters, World::_receivers, World::_targets (private member vectors storing the entities)
  • Wiki Pages: World Multipath Initialization (as it modifies entity lists), XML Parsing (responsible for calling World::add)

Validation Status

  • Needs Verification: While fundamental, the process of adding entities and the immutability of the lists post-setup (except for multipath) should be explicitly verified. Ensure unique_ptr ownership semantics are handled correctly throughout. Confirm behavior if configuration attempts invalid additions (though likely caught during parsing).
  • Key Areas for Validation:
    • Confirm successful addition of all entity types (Platform, Transmitter, Receiver, Target).
    • Verify that entity lists retrieved via getter methods accurately reflect the added entities.
    • Ensure lists are correctly modified (only) during the World::processMultipath step if multipath is enabled.
    • Confirm that no other simulation logic attempts to modify these core lists after setup.
  • Priority: Low (Core functionality, likely stable, but foundational)

Clone this wiki locally