//构造使用PS业务的用户 public static User CreatUser_PS() { Mobility mobility = new Mobility("mobility", 30); //构造业务参数 UnionPsService unionPsService = new UnionPsService(); Dictionary<NetWorkType, Service> PSServiceDic = new Dictionary<NetWorkType, Service>(); TDPsService tdPsService = new TDPsService(); tdPsService.TDR99Bearer = new TDR99Bearer(); PSServiceDic.Add(NetWorkType.TDSCDMA, tdPsService); unionPsService.PSServiceDic = PSServiceDic; //构造终端参数 Terminal terminal = new Terminal(); List<NetworkTerminal> terminalList = new List<NetworkTerminal>(); TDTerminal tempTerminal = new TDTerminal(); tempTerminal.NoiseFigure = 2; tempTerminal.NetType = NetWorkType.TDSCDMA; tempTerminal.MinTxPower = 24; tempTerminal.MaxTxPower = 36; terminalList.Add(tempTerminal); terminal.NetTerminalList = terminalList; User user = new User(mobility, unionPsService, terminal, LinkType.Uplink, 1); user.Id = 1; return user; }
public void GetProcGainTest() { TDPredictionGroup pg1 = new TDPredictionGroup(); TDPredictionGroup pg2 = new TDPredictionGroup(); pg1.TrafficService = new UnionCsService(); pg2.TrafficService = new UnionPsService(); TDCsService service1 = new TDCsService(); TDPsService service2 = new TDPsService(); ((UnionCsService)pg1.TrafficService).CSServiceDic[NetWorkType.TDSCDMA] = service1; ((UnionPsService)pg2.TrafficService).PSServiceDic[NetWorkType.TDSCDMA] = service2; TDR99Bearer TDR99Bearer = new TDR99Bearer(); service1.TDR99Bearer = TDR99Bearer; service2.TDR99Bearer = TDR99Bearer; float [] actual1=TDPredictionCommonCalc.GetProcGain(pg1); float[] actual2 = TDPredictionCommonCalc.GetProcGain(pg2); float[] expected1 = { service1.TDR99Bearer.UlPG, service1.TDR99Bearer.DlPG }; float[] expected2 = { service2.TDR99Bearer.UlPG, service2.TDR99Bearer.DlPG }; Assert.AreEqual(actual1, expected1); Assert.AreEqual(actual2, expected2); }
public void GetTxPowerTest() { TDPredictionGroup pg1= new TDPredictionGroup(); TDPredictionGroup pg2 = new TDPredictionGroup(); pg1.TrafficService = new UnionCsService(); pg2.TrafficService = new UnionPsService(); TDCsService service1 = new TDCsService(); TDPsService service2= new TDPsService(); ((UnionCsService)pg1.TrafficService).CSServiceDic[NetWorkType.TDSCDMA] = service1; ((UnionPsService)pg2.TrafficService).PSServiceDic[NetWorkType.TDSCDMA] = service2; TDR99Bearer TDR99Bearer = new TDR99Bearer(); service1.TDR99Bearer = TDR99Bearer; service2.TDR99Bearer = TDR99Bearer; float actual1=TDPredictionCommonCalc.GetTxPower(pg1); float actual2 = TDPredictionCommonCalc.GetTxPower(pg2); float expected1= service1.TDR99Bearer.PtchMax; float expected2 = service2.TDR99Bearer.PtchMax; Assert.AreEqual(expected1,actual1 ); Assert.AreEqual(expected2, actual2); }
public void HSPDSCHCIRCase_2() { ((TDSCDMACarrier)m_Cell).CarrierType = CarrierTypeOfTD.HSPA; m_BestServerCellID[m_Index] = (short)m_Cell.ID; m_Case.Name = m_Name; m_Cell.FreqBand.BandWidth = 1.6f; m_CellList.Add(m_Cell); //m_BestServerCellID[0] = 0; m_HSPDSCHRSCP[0] = 10; tdGroup.PsService = new UnionPsService(); TDPsService tdService = new TDPsService(); tdService.EnableHsdpa = true; tdGroup.PsService.PSServiceDic.Add(NetWorkType.TDSCDMA, tdService); tdGroup.TrafficService = (Service)tdGroup.PsService; RunCase(); m_Name = m_Case.Name; ValueMatrixShort hSPDSCHCIR = m_Context[ContextKeys.HSPDSCHCI] as ValueMatrixShort; Assert.AreEqual(110.06, UnitTrans.ShortToDouble(hSPDSCHCIR[0]), 0.01); }