-
Notifications
You must be signed in to change notification settings - Fork 8
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
MRO #17
base: main
Are you sure you want to change the base?
MRO #17
Conversation
Mobility model Param Regression and all code Black Formatter
black format all the code (lf-connectivity#16)
|
def __init__( | ||
self, | ||
ue_data: pd.DataFrame, | ||
topology: pd.DataFrame, | ||
prediction_data: pd.DataFrame, | ||
tx_power_dbm: int = 23, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add docstrings explaining format and/or content of each parameter
# Scatter plot of the Cell towers and UE Locations | ||
|
||
|
||
def mro_plot_scatter(df, topology): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move to notebook
A class to perform Mobility Robustness Optimization (MRO) using Bayesian Digital Twins. This class integrates | ||
user equipment (UE) data with cell topology to predict the received power at various UE locations and | ||
determines the optimal cell attachment based on these predictions. The class uses Bayesian modeling to | ||
accurately forecast signal strength, accounting for factors such as distance, frequency, and antenna characteristics. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A class to perform Mobility Robustness Optimization (MRO) using Bayesian Digital Twins. This class integrates | |
user equipment (UE) data with cell topology to predict the received power at various UE locations and | |
determines the optimal cell attachment based on these predictions. The class uses Bayesian modeling to | |
accurately forecast signal strength, accounting for factors such as distance, frequency, and antenna characteristics. | |
A class that contains a prototypical proof-of-concept of an `Mobility Robustness Optimization (MRO)` RIC xApp. |
|
||
def update(self, new_data: pd.DataFrame): | ||
""" | ||
Updates or trains Bayesian Digital Twins for each cell with new data. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updates or trains Bayesian Digital Twins for each cell with new data. | |
(Re-)train Bayesian Digital Twins for each cell. |
|
||
if self.bayesian_digital_twins: | ||
self.update_data = new_data | ||
updated_data = self._preprocess_ue_update_data() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep this as a helper static method to generate dummy data (for e.g. in a notebook) and then use that (as if it were real data) to train the twins.
if not isinstance(new_data, pd.DataFrame): | ||
raise TypeError("The input 'new_data' must be a pandas DataFrame.") | ||
|
||
expected_columns = {"mock_ue_id", "longitude", "latitude", "tick"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expected := [lat, lon, cell_id, "rsrp_dbm"] where 'cell_id' can be cross-referenced into topology (to get cell_lat and cell_lon).
|
||
return predicted, full_prediction_df | ||
|
||
def _connect_ue_to_all_cells( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def _connect_ue_to_all_cells( | |
def _prepare_all_UEs_from_all_cells_df( |
except Exception as e: | ||
print(f"An unexpected error occurred: {e}") | ||
|
||
def save(bayesian_digital_twins, file_loc): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return NotImplemented()
to refine the decision process for UE cell attachment. | ||
""" | ||
self.simulation_data = get_ue_data(self.mobility_params) | ||
ue_data = self._preprocess_ue_simulation_data() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here, we need to use (previously trained) twins to predict each lat/lon from each cell.
except Exception as e: | ||
print(f"An unexpected error occurred: {e}") | ||
|
||
def solve(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def solve(self): | |
def _calculate_metric(self, lambda: perform_attachment, **kwargs): |
have another method :
def solve(self) -> Optional[Tuple[float]]:
# repeatedly evaluate self._calculate_metric(perform_attachment)
# return new optimized parametrization of perform_attachment
# currently `perform_attachment` has no params
# e.g. self._calculate_metric(perform_attachment)
# in the future, you will have `perform_attachment_hyst_ttt`
# that can be optimized by a simple for-loop grid search
# through TTT and hyst, where we repeatedly call
# self._calculate_metric(perform_attachment_hyst_ttt, **kwargs)
# and return the optimal [TTT, hyst]
Test MRO app
Description:
This PR implements a robust simulation for optimizing UE mobility by predicting the best cell attachments using Bayesian Digital Twin models. It includes a pipeline of functions for data preprocessing, training, and prediction to enhance network connectivity stability. Some unittest cases for the functions are also added.
Functions:
_preprocess_ue_topology_data
: Combines UE and topology data, adding derived features like log distance and received power, preparing for Bayesian Digital Twin training._preprocess_ue_training_data
: Prepares training data, processing each cell's data and populating it with relevant features (log distance, relative bearing, cell power)._preprocess_prediction_data
: Prepares prediction data in the same format as training data, generating features required for Bayesian Digital Twin predictions.training
: Trains Bayesian Digital Twin models for each cell using UE data, enabling accurate prediction of cell power based on UE features.predictions
: Uses the Bayesian Digital Twin models to predict received power at various UE locations, then selects the best cell for each UE using the perform_attachment function.mro_plot_scatter
: Visualizes cell towers and UE locations, color-coded by cell attachment or RLF (gray) based on SINR values.