-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Draft] Basic Tracefile with Dynamic Vehicle Entry/Exit + some other fixes #37
base: main
Are you sure you want to change the base?
Conversation
…n to manually specify simID
1. When writing the "mainout" file, using a "marker file" to indicate that the "mainout" file is writing now. In case of multiple processes write the file simultaneously. 2. If the outputs of different simulations are in one folder, the auto-set simIDs could not support "parfor". We may need another effective way to fix this promble.
…sim-id additional options for controlling simID and the main output file
make the main function return output and used params
…case/WiLabV2Xsim into dev-parallel-and-tracefile
…e/WiLabV2Xsim into dev-parallel-and-tracefile
Pos delay enhancement
Thanks Chester for your very appreciated contribution.
We will do our best to look at your code, although we can't promise to process it as soon as it would deserve.
A comment from my side is that, assuming that I correctly understood your text, the functionality you are describing was in principle already implemented in the simulator.
Indeed, for this scope some of the vectors/matrixes use indexID and others directly the ID. When the indexID is used, this is because not all consecutive IDs may be active and we need to keep some matrixes as small as possible. As an example, the matrix including the channel gain has a number of rows and columns equal to the "active" users and not the "possible" users.
The addition and removal of IDs is managed within the function "updatePositionFiles".
Alessandro Bazzi, Ph.D.
Associate Professor @ DEI, Università di Bologna
Associated with WiLab, CNIT
www.alessandrobazzi.com<http://www.alessandrobazzi.com/>
Phone: +39-051-2093880
…________________________________
Da: Chester Koh ***@***.***>
Inviato: lunedì 22 aprile 2024 09:10
A: V2Xgithub/WiLabV2Xsim ***@***.***>
Cc: Subscribed ***@***.***>
Oggetto: [V2Xgithub/WiLabV2Xsim] [Draft] Basic Tracefile with Dynamic Vehicle Entry/Exit + some other fixes (PR #37)
Hi V2XSim Maintainers,
I have a working version of the sim with dynamic vehicle entry/exit partially supported for you to review. The approach/constraints are as follows:
* The maximum number of active vehicles throughout the simulation is set constant at the beginning of the simulation.
* The vehicle ids in the tracefile must be consecutive integers from 1 to XXX (use a python script to preprocess the bologna tracefiles)
* A rectangle bound in world coordinates is specified using XminTrace, XmaxTrace, YminTrace, YmaxTrace
* To mark a vehicle as active, the tracefile has a log line that shows the vehicle within these bounds
* When a vehicle exits from the simulation, the tracefile adds a log line in the next epoch that "teleports" the vehicle outside these bounds
* Vehicles "inactive" stay in some arbitary place outside of the active rectangle bound and do not request BR etc. They still tick for position updates and physics calculations (change in LOS/shadowing), but do not schedule any packets so the centralized algorithms do not schedule them any BR.
* For the vehicle to become active again, the tracefile adds another log line to teleport the vehicle back within these bounds
Using this approach I have a rudimentary support of dynamic vehicle entry/exit. The ideal scenario would be to exclude inactive vehicles from physics calculations entirely to speed up the simulation, but currently it is good enough for my current studies that requires tracefiles.
My studies is specifically 5GNR centralised mode, so I will need your help to review the PR to test the other modes (decentralised, and maybe vehicular wifi)
This PR contains some other files i accidentally committed from many months ago like MatFilesVisualization for my own studies but not fully functional by themselves yet. But the bulk of the changes that supports the tracefile is in the last commit.
Attached is the modified BolognaAPositions with the constraints (consecutive vehicle numbers, and "teleporting" inactive vehicles to coordinates 0,0 ), preprocessed using Python.
BolognaAPositions.csv<https://github.com/V2Xgithub/WiLabV2Xsim/files/15058862/BolognaAPositions.csv>
________________________________
You can view, comment on, or merge this pull request online at:
#37
Commit Summary
* 8d1b816<8d1b816> add output parameter to suppress printing to main file, and add option to manually specify simID
* 09f55f0<09f55f0> make the main function return output and used params
* c7bfb1b<c7bfb1b> update for parallel task based on pr/24
* f2d63c8<f2d63c8> Merge pull request #24 from chesnutcase/print-main-file-and-sim-id
* fa34ab3<fa34ab3> Merge pull request #25 from chesnutcase/main-returns-outputs
* d7ad5ba<d7ad5ba> add support for counting hidden node events, and add unit tests
* ad5de75<ad5de75> fix typo in test case for hiddenNode, should be FD not HD
* 5d86130<5d86130> attempt to support a configurable buffer size
* 2279a95<2279a95> merge
* 356227e<356227e> Merge branch 'configurable_buffer_size' of https://github.com/chesnutcase/WiLabV2Xsim into dev-parallel-and-tracefile
* 6f48040<6f48040> enhance usage of posDelay, add posPacketLoss param
* 4e99b43<4e99b43> fix typo in class member of constants class
* 2296293<2296293> Merge branch 'pos_delay_enhancement' of https://github.com/chesnutcase/WiLabV2Xsim into dev-parallel-and-tracefile
* 6511566<6511566> fix wrong bounds check for simParams.posPacketLoss
* 8fa1a46<8fa1a46> fix wrong constant name
* 6524130<6524130> Merge pull request #1 from SUTDFCCLab/pos_delay_enhancement
* 8dcbdcb<8dcbdcb> rudimentary support for dynamic vehicle entry and exit in traffic trace
File Changes
(45 files<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files>)
* M MainFiles/mainInit.m<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-24c7055d78d09becfe15b59224ded9c20bf6901de892f7384a07b4c8e2ffc60b> (45)
* M MainFiles/mainPositionUpdate.m<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-6c283ff16b9feffcdc7c79b61e42f6797101479d7fc93ba8e78c3e566afa60a7> (55)
* M MainFiles/mainV2X.m<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-72804edd814114480f7ef2963dbde2678c0062530f15209999e8f9a5385d0767> (7)
* M MainFilesCV2X/elaborateFateRxCV2X.m<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-1eeaa61dba5e215ce6438534af1c43b79f8f5b3e068db66fd8e2204a5de2f776> (16)
* M MainFilesCV2X/initLastPowerCV2X.m<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-8b29eaf063c343a65559814d12fc3eb267f081c33ffeebe56454f912e214060f> (4)
* M MainFilesCV2X/mainCV2XttiEnds.m<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-db47da366710a22a22a44bfb7dc40cac2c1aa637d482106454d8abf1a47e6923> (10)
* M MainFilesCV2X/mainCV2XttiStarts.m<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-e571aead29a07ba408cb52f0894bcd27eb223d324bd4bc946135bb2792937e00> (8)
* M MainFilesCV2X/updateKPICV2X.m<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-7c692fc3b1731cbc1010f6e7234e4ccee7bf57be4e3e9430bc4cc0b7bac8a086> (8)
* M MainFilesIEEE802.11p/updateVehicleEndingTx11p.m<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-c9d040bb1b829087760c0cd3d171c694aaaf4c9839c2e35f31eb0eb520143473> (2)
* M MatFilesInit/constants.m<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-89997784f2cc24ac7816ade2f36de5237e8c4d25f959e83b12ab1c67c8222cfe> (9)
* M MatFilesInit/initiateApplicationParameters.m<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-6744962167d950da11b9fff9e27978982784ae477b5e692a65822347f0dcef75> (8)
* M MatFilesInit/initiateBRAssignmentAlgorithm.m<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-3b0092e5ea2b9bf28c34d455807fd8c5654af4a2201a80c21e5866e8b6af96b4> (514)
* M MatFilesInit/initiateMainSimulationParameters.m<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-f5010d0ee77d50fd3778655a9f3fd82a904f5d0e2998c58a699d45073daa020b> (12)
* M MatFilesInit/initiateOutParameters.m<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-dacc6e5cf17963d54bf092ea2ee0eeab71c3c5f19e4e7a32839651cd150e713b> (57)
* A MatFilesOut/countHiddenNodeEvents.m<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-788e44b516606d5f691d8a663a060112f0605c00904d3603fdc527b5e2081c98> (30)
* M MatFilesOut/outputToFiles.m<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-155c25f21383fbee1b5f5aae7c151e8bb80e7fd8bc8ef9e04f92b2ac6a651b66> (29)
* A MatFilesOut/printHiddenNodeEvents.m<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-3768fe559e20b8912b1a3e0e92c28920e0da2ea641094afb009c24c15f54b7b6> (17)
* A MatFilesOut/printVehiclePositionsToFile.m<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-0251653116f9b6a78ab082651b9eb4a7dea7681caf69428787755a869dfc8dc7> (21)
* M MatFilesPosition/addPosDelay.m<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-172c07e15cd5327a0e8a6aeaf17e2507039faae81334452d6c29eaba9796f5e7> (97)
* A MatFilesPosition/checkVehicleBounds.m<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-3dd08ec8db04813eef8fa696841ab623e19db072640275a08d3161baeb5d1330> (23)
* M MatFilesPosition/initVehiclePositions.m<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-2a7eb4f5e4ee21c806c6670893179f529d2a31c960c6e751d2ca39932bf56dca> (25)
* D MatFilesPosition/interpolateTrace.m<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-8c98829bbf312f86d0fdcc6e976beab43b6c959479843fe8cba07474c281e505> (123)
* M MatFilesPosition/loadTrafficTrace.m<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-dd23f57f9a6a1a082d3d0ddec2d4417ae080396d58a0b3d643b4296592ed7f54> (146)
* M MatFilesPosition/updateDistanceChangeForShadowing.m<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-7180c904924e44a57e6ec7c478a7f30f644a1d391db6871ec45df7e04b961b61> (35)
* M MatFilesPosition/updatePositionFile.m<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-61c4e5a4c414a9a7541816ab83b035e1c6e60573e7dcc08ee0c9d42cc10e885f> (80)
* M MatFilesResourceAllocationCV2X/BRreassignmentRandom.m<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-8365ebb063b6d593a070cdcfd762673334d102a4697bf474cde55bafeb8daa29> (6)
* M MatFilesResourceAllocationCV2X/CV2XsensingProcedure.m<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-9811ccf376b0a86b35cccf59597427aff0c82f6da2da755ed5ba8c7814531c39> (8)
* M MatFilesSINR/computeChannelGain.m<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-350208a2e3461eab733fa50324aa3e66925a67ffc642157aa45eacce9c778987> (67)
* M MatFilesUtility/computeDistance.m<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-256be92ff2e5e1cc5a5440b88d35b4ed3c32e9a4175e2f2ba257b152fdee0b25> (19)
* M MatFilesUtility/computeNeighbors.m<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-234f869e117a8fd8378e4f5da310bd357eba74a2d1632588d35d7e39091a9695> (79)
* A MatFilesVisualization/BRGraphInit.m<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-0efe2c22c5f3771bff018fb711e9f1caa83d08541e68210a394b46f74a461858> (40)
* A MatFilesVisualization/BRGraphUpdate.m<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-add009f739ee3f72aa325fdc3f907a565a64f688e2e52b771f7991b9c687dc2f> (29)
* A MatFilesVisualization/BufferGraphInit.m<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-27c7f48fedf1533726b4c8f242906deefa2276cb72f67c0e18c1f788cbed265b> (14)
* A MatFilesVisualization/BufferGraphUpdate.m<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-a6511546730810a5e00979eac0e6ada3a7c8a89cd83ce29f27560bb7d7d0a704> (6)
* A MatFilesVisualization/DebugErrors/ChaseVehicle.mlapp<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-9e69b3c6929cac0b9311f46fd56c790cd03f67fee9b3ade8bb7192c23558a67f> (0)
* A MatFilesVisualization/DebugErrors/DebugErrors.mlapp<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-5d159ebcb72e3f24a7994388b43a4e46782cf749a4f2ae1189d9b32ff359bd3b> (0)
* A MatFilesVisualization/DebugErrors/LoadExperiment.m<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-f76f39c81e0b34d9e9cd07c4f02c16c5fb58b4e34c09983fb3618725bd2cef7c> (76)
* A MatFilesVisualization/DebugErrors/ReviewExperiment.mlx<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-f2ed05bf7ae4b303a557a48ac0b15f2a7a86f865bd5e653cd52fa9ac67a64595> (0)
* A MatFilesVisualization/DebugErrors/V2XSimErrorDebugger.prj<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-b61572b9049e20096b6f2bd114f1d7224feda6f13df8377aecfc10b1b1b6250b> (117)
* A MatFilesVisualization/ReviewResults.mlx<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-0588de1f68d930b0ee76ce504f1b5e95ce908dd3013b5fb0e1bdd8d6cf60c785> (0)
* M README.md<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5> (2)
* M Simulations_test_trace.m<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-9ff399f2db5619f5a1874bc93bec91986f4d469e28e0d41fd8cbfbf401464dea> (36)
* A Tests/+v2xsim_tests/+unit/+out/test_countHiddenNodeEvents.m<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-a2dfa883235ed17d72603f296e231f6545449ee3976f9d860b5f31282fe17f88> (66)
* A Tests/+v2xsim_tests/+unit/+position/test_addPosDelay.m<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-41a34cb93c13d74577e1da7fa6388de54a40d64b8674e1fe7fbd2aa6c48a705d> (94)
* M WiLabV2Xsim.m<https://github.com/V2Xgithub/WiLabV2Xsim/pull/37/files#diff-09ecf55601732f4dffbf3d4b8218b8b01934471fbbb37f700a50de4d76a5785c> (23)
Patch Links:
* https://github.com/V2Xgithub/WiLabV2Xsim/pull/37.patch
* https://github.com/V2Xgithub/WiLabV2Xsim/pull/37.diff
—
Reply to this email directly, view it on GitHub<#37>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AUR65OTAPFQUV6FHNT3JID3Y6SZYDAVCNFSM6AAAAABGSF5PNSVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI2TKNZVG44TEMY>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
😅 thanks for your prompt reply in any case, i will continue optimizing the code for full tracefile support because i need it for my studies. yes, I am aware that some of the data structures like channel gain uses matrix indices - the challenge now is to find these matrices that will require resizing when vehicles enter/exit. first i will work on removing exited vehicles from physics ticks (e.g. channel gain calculation) , then i will look into using tables instead of matrices (recent MATLAB 2023 feature: using tables in place of matrices) so that we can use arbitrary string indices everywhere (since row names are strings). It should be faster and more maintainable than trying to remember which data structure is indexed using what. |
Hi V2XSim Maintainers,
I have a working version of the sim with dynamic vehicle entry/exit partially supported for you to review. The approach/constraints are as follows:
XminTrace, XmaxTrace, YminTrace, YmaxTrace
Using this approach I have a rudimentary support of dynamic vehicle entry/exit. The ideal scenario would be to exclude inactive vehicles from physics calculations entirely to speed up the simulation, but currently it is good enough for my current studies that requires tracefiles.
My studies is specifically 5GNR centralised mode, so I will need your help to review the PR to test the other modes (decentralised, and maybe vehicular wifi)
This PR contains some other files i accidentally committed from many months ago like
MatFilesVisualization
for my own studies but not fully functional by themselves yet. But the bulk of the changes that supports the tracefile is in the last commit.Attached is the modified BolognaAPositions with the constraints (consecutive vehicle numbers, and "teleporting" inactive vehicles to coordinates 0,0 ), preprocessed using Python.
BolognaAPositions.csv