Example #1
0
        public void LoadTest()
        {
            Dictionary<NetWorkType,List<ISimCellBase>> m_CellDic = new Dictionary<NetWorkType,List<ISimCellBase>>();
            ISimCellBase cell1 = new MockCell();
            cell1.CoSimuLoad = 1f;
            ISimCellBase cell2 = new MockCell();
            cell2.CoSimuLoad = 2f;
            ISimCellBase cell3 = new MockCell();
            cell3.CoSimuLoad = 3f;

            ISimCellBase cell4 = new MockCell();
            cell4.CoSimuLoad = 2f;
            ISimCellBase cell5 = new MockCell();
            cell5.CoSimuLoad = 3f;
            ISimCellBase cell6 = new MockCell();
            cell6.CoSimuLoad = 4f;

            ISimCellBase cell7 = new MockCell();
            cell7.CoSimuLoad = 1f;
            ISimCellBase cell8 = new MockCell();
            cell8.CoSimuLoad = 1f;

            List<ISimCellBase> tdCells = new List<ISimCellBase>();
            tdCells.Add(cell7);
            tdCells.Add(cell8);

            List<ISimCellBase> gsmCells = new List<ISimCellBase>();
            gsmCells.Add(cell6);
            gsmCells.Add(cell5);
            gsmCells.Add(cell4);
            List<ISimCellBase> umtsCells = new List<ISimCellBase>();
            umtsCells.Add(cell3);
            umtsCells.Add(cell2);
            umtsCells.Add(cell1);

            m_CellDic.Add(NetWorkType.GSM, gsmCells);
            m_CellDic.Add(NetWorkType.UMTS, umtsCells);
            m_CellDic.Add(NetWorkType.TDSCDMA, tdCells);

            List<NetWorkType> typeList = new List<NetWorkType>();
            typeList.Add(NetWorkType.GSM);
            typeList.Add(NetWorkType.UMTS);
            typeList.Add(NetWorkType.TDSCDMA);
            m_Target = new NetWorkTypeSort(typeList, m_CellDic);
            List<NetWorkType> res = m_Target.Sort(AllocateUserType.Load);
            Assert.AreEqual(NetWorkType.GSM, res[0]);
            Assert.AreEqual(NetWorkType.UMTS, res[1]);
            Assert.AreEqual(NetWorkType.TDSCDMA, res[2]);

            List<NetWorkType> smallTypeList = new List<NetWorkType>();
            smallTypeList.Add(NetWorkType.TDSCDMA);
            smallTypeList.Add(NetWorkType.UMTS);
            smallTypeList.Add(NetWorkType.GSM);
            m_Target = new NetWorkTypeSort(smallTypeList, m_CellDic);
            res = m_Target.Sort(AllocateUserType.Load);
            Assert.AreEqual(NetWorkType.GSM, res[0]);
            Assert.AreEqual(NetWorkType.UMTS, res[1]);
            Assert.AreEqual(NetWorkType.TDSCDMA, res[2]);
           
        }
Example #2
0
        public void QoSTest()
        {
            Dictionary<int, NetWorkType> qosNets = new Dictionary<int, NetWorkType>();
            qosNets.Add(1, NetWorkType.GSM);
            qosNets.Add(2, NetWorkType.UMTS);
            qosNets.Add(0, NetWorkType.TDSCDMA);
            m_Target = new NetWorkTypeSort(qosNets);
            List<NetWorkType> typeRes = m_Target.Sort(AllocateUserType.QoS);
            Assert.AreEqual(NetWorkType.TDSCDMA, typeRes[0]);
            Assert.AreEqual(NetWorkType.GSM, typeRes[1]);
            Assert.AreEqual(NetWorkType.UMTS, typeRes[2]);
 
        }
Example #3
0
        /// <summary>
        /// 迭代计算
        /// </summary>
        private void CalcIteration()
        {
            Dictionary<NetWorkType, List<ISimCellBase>> cellDic = GetNetCellDic();
            NetWorkTypeSort netWorkSort = new NetWorkTypeSort(m_Nets, cellDic);
            netWorkSort.NetQosDic = m_UIParam.NetDic;

            List<NetWorkType> netWorkQueue = netWorkSort.Sort(m_UIParam.AllocateType);

            AllocateUser allocatUser = new AllocateUser(m_Nets, m_LoadStatusDic, m_SnapshotContext, m_UIParam.AllocateType, m_VersionDic);
            SetAllocatUserProperty(m_UIParam, allocatUser);
            allocatUser.SetUsers(m_Users);
            RunSnapshots(netWorkQueue, allocatUser);

        }