forked from stpaine/FERS
-
Notifications
You must be signed in to change notification settings - Fork 1
World Shared Resource Management
David Young edited this page Apr 30, 2025
·
1 revision
The World class provides a mechanism to store and manage shared, named resources used by various simulation entities. This currently includes:
-
RadarSignalobjects (representing pulse waveforms) -
Antennaobjects (defining antenna characteristics) -
PrototypeTimingobjects (defining configurations for timing sources and noise)
These resources are typically defined once (e.g., when parsing the XML configuration) and added to the World. Later, other entities like Transmitter or Receiver objects can retrieve references to these shared resources using their unique names. This promotes configuration reuse (e.g., multiple radars using the same antenna model) and simulation modularity.
- Assumes resource names (strings) are unique within each resource category (
RadarSignal,Antenna,PrototypeTiming). Adding a resource with a duplicate name in the same category is considered an error. - Assumes resources are defined and added to the
Worldbefore entities (likeTransmitterorReceiver) attempt to retrieve them by name during the simulation setup phase (typically during XML parsing). - Assumes that the code attempting to retrieve a resource (e.g., the XML parser calling
World::findAntenna) correctly handles the case where the resource is not found (i.e., thefindmethod returnsnullptror equivalent).
- Exact Name Matching: Resource lookup relies on exact string matching for names. This matching is likely case-sensitive (needs verification).
- No Pattern Matching: There is no support for finding resources using wildcards or other pattern-matching techniques. Resource retrieval requires knowing the exact name.
-
Duplicate Name Errors: Attempting to add a resource with a name that already exists within the same category will throw a
std::runtime_error. The calling code (e.g., the main setup routine or XML parser) must be prepared to handle this exception gracefully.
-
World::add()methods (overloads forRadarSignal,Antenna,PrototypeTiming) -
World::findSignal(),World::findAntenna(),World::findTiming()methods - Private member maps within
World(e.g.,_signals,_antennas,_timings) used for storage. -
XML Parsing (relies on
findmethods during configuration) - World Model (overall context for this functionality)
- Needs Verification: The fundamental add/find mechanism needs verification under various scenarios, especially error conditions and edge cases related to naming.
-
Key Areas for Validation:
- Confirm that attempting to add a resource with a duplicate name reliably throws the expected
std::runtime_error. - Verify the behavior when attempting to find a resource with a name that does not exist (should return
nullptror equivalent, and calling code should handle it). - Confirm the exact behavior of name matching (e.g., definitively test case sensitivity).
- Test basic add-then-find success scenarios for all supported resource types (
RadarSignal,Antenna,PrototypeTiming). - Ensure correct behavior when resource names contain unusual characters (if allowed).
- Confirm that attempting to add a resource with a duplicate name reliably throws the expected
- Priority: High (This is fundamental infrastructure required for simulation setup; errors can prevent simulations from configuring or running correctly).