[[TOC(Software/eAM*, depth=2, heading=Aggregate Managers)]] == METIS II 5G Visualization - Trace Generation Extension == Using the METIS II 5G Visualization for simulation of an urban environment, time-variant attenuation (path loss) traces can be generated to approximate real world situations. These traces can then be used on an attenuator matrix based test bed, such as [wiki:Hardware/bDomains/cSandboxes/dSB4 Sandbox 4], for tightly controlled experiments with various protocol and connection methodologies. An extension to the simulator is available to generate these trace files through the selection of objects of interest (pedestrians, cars, base stations, etc.) and calculation of distance and occlusion based free space path loss at regular intervals. Note that these calculations do not take into account multi-path or sources of noise. The path loss between object pairs is calculated as follows: Total Path Loss = Free Space Path Loss(d, f) + Object Attenuation(k) Free Space Path Loss(d, f) = 20 log,,10,,(d) + 20 log,,10,,(f) - 27.55 Assuming f = 2385 MHz gives the “typical” path loss of approximately 40dB at 1 meter. Object Attenuation(k) = a,,1,,n,,1,, + a,,2,,n,,2,, + ... + a,,k,,n,,k,, a = attenuation factor in dB for object type “k” [[BR]]n = number of “k” type objects between the two objects of interest Addition of this extension to the simulator is done through minor modification of the simulator's source code as described below. Configuration of the desired trace generation is done through an XML file which can be created manually or through the [wiki:foo XML Generator]. [[BR]] === Adding the Trace Generation Extension code to METIS II 5G Visualization source === The following documentation gives an overview of the changes that have to be made to the original METIS II simulator for it to have the ability to generate pairwise attenuation traces for selected objects in the simulator. 1. Adding an empty object to the scene: a. Under the Hierarchy tab, select the ‘Stage’ object, right click on it and choose ‘Create Empty’. b. Rename it to Tracker and under the Inspector tab of Unity, click Add Component button. c. Select Scripts and add the [attachment:TrackObject_Test.cs TrackObject_Test.cs] file d. Alternatively, add a new script and paste the code from Track Object_Test.cs after renaming the class Track Object_Test to whatever name was given to the script. 2. Adding tags to !GameObjects: a. Under the project tab, search for the object Antenna5G_01 b. In the inspector tab, click on the Tag dropdown and choose ‘Add Tag..’. c. In the Tags and Layers window, inside the Inspector tab, click on ‘+’ and add the tag “Antenna”. d. Now, select Antenna5G_01 from the Project tab and the tag ‘Antenna’ should be available. Click on Antenna to add that tag to the !GameObject. e. Repeat the same steps for the following objects i. Person, !StaticPerson – Pedestrian ii. !MadridGrid, MadridGridRectangle8, MadridGridRectangle10, !MadridGridSquare – Building iii. Sensor – Sensor iv. lamp-single-ap-002 – Lightpole v. CarSedan01 – Car vi. Bus – Bus 3. Adding Collider to !GameObjects: a. For getting a list of the objects the ray hits between the source and the destination object, it is necessary to add Box Colliders to each of the objects that the ray might pass through. b. For the models !MadridGrid, MadridGridRectangle8, MadridGridRectangle10, Person, !StaticPerson and Sensor, add Box Collider components c. For adding it, select the model from the Project tab and in the Inspector tab, select !AddComponent -> Physics -> Box Collider. 4. Generating a build: a. Once all of the above has been done, generate a build by selecting File -> Build Settings b. Choose the Target Platform, Architecture and hit Build. c. Make sure that the config file “config.xml” is located in the running directory. In its absence, the simulator runs normally. [[BR]] === XML Configuration File === The Trace Generation Extension requires an XML configuration file which is used to select object pairs for which path loss is to be computed as well as setting specific calculation related parameters. You can create your own config file manually, or use the TODO [wiki:foo XML Generator] to create one for Sandbox 4. Below is an overview of the different sections of the config file and how they function. A sample XML file ([attachment:config.xml config.xml]) is provided for reference. {{{ 2,3,4 1,3,4 1,2,4 1,2,3 6,7,8,9 5,7,8,9 5,6,8,9 5,6,7,9 5,6,7,8 2,3,4,5 1,3,4,5 1,2,4,5 1,2,3,5 1,2,3,4 }}} '''''' This section contains global trace related simulation parameters. ||='''Parameter'''=||='''Description''' =|| || max_time || Number of seconds to run the simulation || || time_int || Time interval (miliseconds) for calculating pairwise attenuations || '''''' Insertion loss attenuations (in dB) of different objects in the simulation are defined here. These are the attenuation factors of objects obstructing line of sight between the two objects for which the pairwise attenuation is being calculated. These factors are not taken into account for the pair of objects themselves. ||='''Parameter'''=||='''Description''' =|| || type || Object type || || value || Insertion loss attenuation in dB || '''''' The links define the independent sets of connections objects in the simulator may have (eg. multi-homing). In terms of [wiki:Hardware/bDomains/cSandboxes/dSB4 Sandbox 4], each link set is mapped to it's own RF attenuator matrix. ||='''Parameter'''=||='''Description''' =|| || name || The identification number of the link (RF matrix number) || || max_obj || The maximum number of objects handled by this link (max number of ports on RF matrix) || || default_attenuation || The default (maximum) attenuation between undefined object pairs || || frequency || The center frequency being used on this link. This can affect path loss calculations by a few dB || ''' ... ''' This defines the objects and object pairs that the user wishes to track and generate trace data for. The comma separated list of numbers are the indices of other objects ''on the same link'' for which pairwise attenuations will be calculated. Because links are bidirectional, if object of index=1 has object of index=2 in its list, object of index=2 does not need to have object of index=1 in it's list. Note that the indices in different links are completely independent of each other. ||='''Parameter'''=||='''Description''' =|| || index || Index of object on this link (port on RF matrix) || || type || Subset of objects to which the object belongs (Bus, Car, etc.) || || id || Specific id of the object being tracked (see valid id table below) || ||='''Object Type'''=||= '''Valid Id''' =|| || Building || ''none'' || || Car || 0 - 404 || || Bus || 0 - 5 || || Pedestrian || 0 - 115 || || Antenna || 0 - 3 || || Lightpole || 0 - 5 || || Sensor || 0 - 9 || [[BR]] === Trace Output CSV File === The output trace file generated at the end of a simulation run is formatted in accordance with the requirements of the [wiki:/Software/eAM/mInstr Instrumentation AM] service for trace replay.