Skip to content
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

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

chestnutcase
Copy link
Contributor

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

chestnutcase and others added 17 commits September 27, 2023 20:53
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
@V2Xgithub
Copy link
Owner

V2Xgithub commented Apr 22, 2024 via email

@chestnutcase
Copy link
Contributor Author

😅 thanks for your prompt reply
the bologna tracefiles were not working out-of-the-box, and from previous discussion with felix i thought full support for tracefiles was abandoned so i was working on getting it working again. i guess the functionality change my version has is that the same vehicle id can re-enter the simulation after exiting. - from trying to reverse engineer the existing codebase, it seems like the original idea was that scenario exit can only happen once.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants