Convert cell_id in ML before optimization 93/118093/2
authorkrishnaa96 <krishna.moorthy6@wipro.com>
Fri, 19 Feb 2021 08:52:38 +0000 (14:22 +0530)
committerkrishna moorthy <krishna.moorthy6@wipro.com>
Sun, 21 Feb 2021 07:55:01 +0000 (07:55 +0000)
Issue-ID: OPTFRA-871
Signed-off-by: krishnaa96 <krishna.moorthy6@wipro.com>
Change-Id: I659ed1acf6147b295df4c0cd8a892eb4dafbf837

apps/pci/optimizers/solver/ml_model.py
test/apps/pci_optimization/test_ml_model.py

index 67402d9..c239be8 100644 (file)
@@ -18,6 +18,7 @@
 
 import json
 
+from apps.pci.optimizers.solver.pci_utils import get_id
 from osdf.adapters.dcae import des
 from osdf.adapters.dcae.des import DESException
 from osdf.config.base import osdf_config
@@ -45,7 +46,7 @@ class MlModel(object):
             cell_id = cell['cell_id']
             average_ho, latest_ho = self.get_ho_details(cell['cell_id'])
             if average_ho > average_ho_threshold or latest_ho > latest_ho_threshold:
-                fixed_cells.add(cell_id)
+                fixed_cells.add(get_id(network_cell_info, cell_id))
 
         fixed_cells.update(dzn_data.get('PCI_UNCHANGEABLE_CELLS', []))
         dzn_data['PCI_UNCHANGEABLE_CELLS'] = fixed_cells
index 3a7f76c..cf0dee5 100644 (file)
@@ -70,7 +70,7 @@ class TestMlModel(unittest.TestCase):
         self.Mock_req = self.patcher_req.start()
         mlmodel = MlModel()
         mlmodel.get_additional_inputs(dzn_data, network_cell_info)
-        self.assertEqual({'Chn0001'}, dzn_data['PCI_UNCHANGEABLE_CELLS'])
+        self.assertEqual({1}, dzn_data['PCI_UNCHANGEABLE_CELLS'])
         self.patcher_req.stop()
 
         dzn_data['PCI_UNCHANGEABLE_CELLS'] = []