public void initial() { m_user1 = MockTDSimUser.CreatTDSimUser_CSDL(); m_user2 = MockTDSimUser.CreatTDSimUser_CSUL(); m_user3 = MockTDSimUser.CreatTDSimUser_PSDL(); m_user4 = MockTDSimUser.CreatTDSimUser_PSUL(); m_user5 = MockTDSimUser.CreatTDSimUser_PSDL(); m_UnAccessedUsers = new List<TDSimUser>(); m_Cell1 = MockTDSimCell.CreatTDSimCell(); m_Cell1.CarrType = CarrierTypeOfTD.R4; m_Cells=new List<TDSimCell>(); m_Cells.Add(m_Cell1); m_Tran = new TDSimTran(m_Cells); initialUser(m_user1, m_Cell1, m_Tran); initialUser(m_user2, m_Cell1, m_Tran); initialUser(m_user3, m_Cell1, m_Tran); initialUser(m_user4, m_Cell1, m_Tran); m_Carrier1 = new TDSCDMACarrier(); m_Transceiver = new Transceiver(); m_R4_CellAssign = new R4_CellAssign(); }
/// <summary> /// 返回小区所属基站的总的下行ce数 /// </summary> /// <param name="cell"></param> /// <returns></returns> private int GetSiteDLCENum(TDSimCell cell) { int result = 0; Site site = cell.Parent.Parent as Site; result = site.DLCETotalNumOfTD; return result; }
/// <summary> /// 为每一个DPA小区初始化时隙资源 /// </summary> /// <param name="tdCell">DPA小区</param> private void InitialHSDPAResouce(TDSimCell tdCell) { foreach (TimeSlot timeSolt in tdCell.HSDPATimeslot) { IACell cell = tdCell.Cell; //判断小区是否动态分配资源(功率和码资源) if (((TDSCDMACarrier)cell).IsDynamic) { timeSolt.HSDPARemainPower = (float)(UnitTrans.mwTodBm(UnitTrans.dBmTomw(tdCell.TxPower) - UnitTrans.dBmTomw(timeSolt.CurPower)-UnitTrans.dBmTomw(timeSolt.HSDPAConsumedPower))); timeSolt.HSDPARemainCodeNum = ConstantParam.RUNumInOneTimeslot - timeSolt.ConsumedCodeNum - timeSolt.HSDPAConsumedCodeNum; if (timeSolt.HSDPARemainPower < 0) { } } timeSolt.HSDPARemainSCCHNum = tdCell.HSDPANumScch; timeSolt.HSDPAConsumedCodeNum = 0; timeSolt.HSDPAConsumedPower = 0; timeSolt.HSDPARemainCodeNum = ConstantParam.RUNumInOneTimeslot; timeSolt.IsTimeSlotScheduled = false; timeSolt.HSDPALoad = 0; timeSolt.CodeDictonary.Clear(); timeSolt.HSDPAScheduledUsers.Clear(); } //tdCell.HSDPAAssignedPower = 0; tdCell.HSDPARemainTSNum = tdCell.HSDPATimeslot.Count; tdCell.HSDPATsNum = tdCell.HSDPATimeslot.Count; tdCell.HSDPACodeNum = ConstantParam.RUNumInOneTimeslot * tdCell.HSDPATsNum; tdCell .TxPowerPerCode = tdCell.HSDPAPower / ConstantParam.RUNumInOneTimeslot; tdCell.HSDPAServedUserList.Clear(); }
[TestInitialize()]//初始化 public void MyTestInitialize() { ue = MockUPAUser.CreateUPAuser(); cell = MockUPAcell.CreatUPACell(); ue.ServiceCell = cell; target = new UserManager(3, 3, 3);//MaxLossTTi,MinCIR,FastLossRemain }
public static TDSimCell CreatTDSimCell() { IACell cell=CreatTDCarrier(); TDSCDMACarrier tdCell = cell as TDSCDMACarrier; tdCell.SwitchPoint = 2; TDSimCell tdSimCell = new TDSimCell(tdCell); tdSimCell.BackNoise_DB = 3; return tdSimCell; }
/// <summary> /// 更新时隙负载 /// </summary> /// <param name="cell"></param> private static void UpdateTSLoad(TDSimCell cell) { foreach (TimeSlot slot in cell.Slots) { if(slot.TsNum!=TS.TS0) { UpdateOneTSLoad(slot,cell); } } }
/// <summary> /// 获得cell上的Rot /// </summary> /// <param name="cell"></param> /// <returns></returns> private static float GetRotOnCell(TDSimCell cell) { float rot = 0; for (int i = 1; i < cell.SwitchPoint + 1; i++) { rot += (float)UnitTrans.dBto(cell.Slots[i].RoT); } rot = (float)UnitTrans.todB(rot / cell.SwitchPoint); return rot; }
/// <summary> /// 更新功率负载 /// </summary> /// <param name="cell"></param> private void UpdatePowerLoad(TDSimCell cell) { //单个时隙的负载 UpdateTSLoad(cell); //小区的上行平均负载 UpdateUlAveLoad(cell); //小区的下行平均负载 UpdateDlAveLoad(cell); //小区的总的平均负载 UpdateAveLoad(cell); }
public void Initial() { m_Collection = new TDSimCellCollection(); m_Cell = MockTDSimCell.CreatTDSimCell(); m_GSMInterfCell=MockIntefGSMSimTRX.CreatGSMSimTRX(); m_UMTSInterCell=MockIntefUMTSSimCell.CreatUMTSSimCell(); m_Collection.TDCells.Add(m_Cell); m_Collection.GSMIntefCells.Add(m_GSMInterfCell); m_Collection.UMTSIntefCells.Add(m_UMTSInterCell); m_InitialTdNE = new InitialTdNE(); }
public void initial() { m_Param = new TDCalcCommonParam(); m_Cells = new List<TDSimCell>(); m_PreCells = new List<TDSimCell>(); m_Cell = MockTDSimCell.CreatTDSimCell(); m_Cells.Add(m_Cell); m_PreCells.Add(m_Cell); m_Param.R4Cells = m_Cells; m_Param.PreSimCells = m_PreCells; m_Reset = new ResetCellResource(); }
/// <summary> /// 选择主小区 /// </summary> private void SetPrimaryCell() { foreach (TDSimCell cell in m_CellList) { cell.TDTran = this; if (cell.IsMainCarrier) { m_PrimaryCell = cell; //break; } } }
/// <summary> /// 对时隙按照指定的优先级排序 /// </summary> /// <param name="cell"></param> /// <param name="slots"></param> /// <param name="direction"></param> private void SortSlot(TDSimCell cell, LinkType direction) { ISlotSort sort = GetSlotSortMethod(); foreach (TimeSlot slot in cell.Slots) { if (direction == slot.LinkDirection && slot.TsNum != TS.TS0) { m_Slots.Add(slot); } } m_Slots.Sort(sort); }
private void CalcTsAndCode(TDSimCell cell) { tsandcode = string.Empty; m_codenum = 0; //for (int i = 1; i <= cell.SwitchPoint; i++) foreach (TimeSlot ts in cell.HSUPATimeSlots) { //TimeSlot ts = cell.Slots[i]; m_codenum += ts.HSUPATotalCode; tsandcode += ts.TsNum.ToString() + ":" + ts.HSUPATotalCode + " "; } }
private static void InitTransSlotParam(TDSimCell cell, int index, float initPower) { cell.Slots[index].AccessedUsers.Clear(); cell.Slots[index].CurPower = initPower; cell.Slots[index].PrePower = initPower; cell.Slots[index].OwnCellInterf = float.NegativeInfinity; cell.Slots[index].OtherSysInterf = float.NegativeInfinity; cell.Slots[index].NeigborCellInterf = float.NegativeInfinity; cell.Slots[index].AvailCodeNum = ConstantParam.RUNumInOneTimeslot; cell.Slots[index].ConsumedCodeNum = 0; cell.Slots[index].R4ConsumedCodeNum = 0; cell.Slots[index].R4MaxCodeNum = ConstantParam.RUNumInOneTimeslot; }
/// <summary> /// 返回小区所属基站的总的小区个数 /// </summary> /// <param name="cell"></param> /// <returns></returns> private int GetCellNum(TDSimCell cell) { IASite site = cell.Parent.Parent; List<TDSimCell> tempCells = new List<TDSimCell>(); foreach (TDSimCell temp in m_Cells) { IASite tempsite = temp.Parent.Parent; if (tempsite == site) { tempCells.Add(temp); } } return tempCells.Count; }
/// <summary> /// 获得单双模用户的数量 /// </summary> /// <param name="cell"></param> private void GetUserTypeNum(TDSimCell cell) { foreach (TDSimUser usr in cell.AccessedUsers) { if (true != usr.IsPolyModelUser) { ++m_SingleUserNum; } else { ++m_MultiUserNum; } } }
private void GetFailUserInfo(TDSimCell cell) { foreach (TDSimUser user in cell.HSUPAFailUE) { if (user.IsPolyModelUser) { m_MultiModeUserNum++; } else { m_FailUserNumSig++; } } }
/// <summary> /// 计算用户的激活集 /// </summary> /// <param name="user"></param> public bool CalculateActive(TDSimUser user) { m_ActiveCell = SelectTryAssignCell(user); if (m_ActiveCell == null) { user.FailReason = FailReason.RscpFail; return false; } float Io = (float)UnitTrans.todB(m_CalcEcIo.GetIo(user, user.PrimeCell)); float EcIo = user.Rscp - Io; user.Ecio = EcIo; return true; }
public void MyInit() { m_cell1 = CreatTDCell(3); m_PreCells = new List<TDSimCell>(); m_PreCells.Add(m_cell1); m_user1 = MockTDSimUser.CreatTDSimUser_CSDL(); m_user2 = MockTDSimUser.CreatTDSimUser_PSUL(); m_user2.ServiceCell = null; m_PreUsers = new List<TDSimUser>(); m_PreUsers.Add(m_user1); m_PreUsers.Add(m_user2); m_ss = new StyleStruct(); m_VecData = new R4SimulationVectorData(m_PreCells, m_PreUsers, m_ss); }
public void Initial() { m_Param = new TDCalcCommonParam(); m_Param.CalcLinkLoss = new MockTDLinkLossCalc(); m_Param.SmartAntGain = new MockSmartAntCalcGain(); m_User = MockTDSimUser.CreatTDSimUser_CSDL(); m_Cell = MockTDSimCell.CreatTDSimCell(); m_Cell.IsMainCarrier = true; m_CellList = new List<TDSimCell>(); m_CellList.Add(m_Cell); m_ActiveCellConfirm = new ActiveCellConfirm(m_CellList); m_ActiveCellConfirm.CommonParam = m_Param; }
public void Excute(List<TDSimCell> bestCellsInCalcRadius,ref TDSimCell bestCell,User user) { float rscp = 0; TDSimCell tempCell = null; foreach (TDSimCell cell in bestCellsInCalcRadius) { float linkLoss = m_Param.CalcLinkLoss.GetLinkLoss(NetWorkType.TDSCDMA, cell.Cell.ID, user.Id, LinkType.Downlink); float bchAntGain = m_SmartAntGainCalc.CalcSingleAntGain(cell, user); if (rscp >= (cell.PccpchPower - linkLoss + bchAntGain) && rscp > m_Param.TdUIParam.RSCPThreshold) { tempCell = cell; } } bestCell = tempCell; }
private void SaveCell(TDSimCell cell) { m_cellname = cell.Cell.Name; m_Rot = cell.HSUPARoT; m_totalNoise = cell.HSUPARoT + cell.BackNoise_DB; m_Load = 1 - (float)UnitTrans.dBto(-m_Rot); CalcTsAndCode(cell); float through = GetThruoghPut(cell); m_ThroughPut = through / (TTI * TTInum); GetFailUserInfo(cell); //测试用 int cenum = cell.ULConsumedCENum; }
private float GetThruoghPut(TDSimCell cell) { float through = 0; foreach (TDSimUser tdue in cell.HSUPASheduleUE) { through += tdue.BitTransmit; if (tdue.IsPolyModelUser) { m_MultiModeUserNum++; } else { m_SucUserNumSig++; } } return through; }
public static List<ISimCellBase> InitialTDInterfCell() { List<ISimCellBase> TDInterfCellList = new List<ISimCellBase>(); IACell aCell = new TDSCDMACarrier(); TDSimCell TDInterfCell = new TDSimCell(aCell); TDInterfCell.Cell.FreqBand.BandWidth = 3f; TDInterfCell.DlFrequency = 2000f; TDInterfCell.DlPower = 33; List<ISimUser> simUserList = new List<ISimUser>(); ISimUser user1 = new MockTDSimUser(); ISimUser user2 = new MockTDSimUser(); simUserList.Add(user1); simUserList.Add(user2); TDInterfCell.ULSimUsers = simUserList; TDInterfCellList.Add(TDInterfCell); return TDInterfCellList; }
public void MyTestInitialize() { m_SimUser1=MockTDSimUser.CreatTDSimUser_CSDL(); m_SimUser2 = MockTDSimUser.CreatTDSimUser_CSUL(); m_IntefUser = MockTDSimUser.CreatTDSimUser_PSDL(); m_Param = new TDCalcCommonParam(); m_Param.SmartAntGain = new MockSmartAntCalcGain(); m_Cell = MockTDSimCell.CreatTDSimCell(); m_User = MockTDSimUser.CreatUser_CSDL(); m_SmartAntGain = new SmartAntGain(m_Param.SmartAntGain); //LinkLossAssist.Init(); //m_TDCalcCommonParam = new TDCalcCommonParam(); //m_TDCalcCommonParam.SmartAntGain = new MockSmartAntCalcGain(); //m_TDSimUser = MockTDSimUser.CreatTDSimUser_CS(); //m_IntefUser = MockTDSimUser.CreatTDSimUser_PS(); //m_TDSimCell = MockTDSimCell.CreatTDSimCell(); //m_SmartAntGain = new SmartAntGain(m_TDCalcCommonParam.SmartAntGain); }
public CellResult(TDSimCell cell) { m_SiteName = cell.Parent.Parent.Name; m_CellName = cell.TdCell.Name; m_MaxPower = cell.MaxPower.ToString(); if (true == cell.IsMainCarrier) { m_PCCPCHPower = cell.PccpchPower.ToString(); m_DwPCHPower = cell.DwpchPower.ToString(); } m_DlLoad = cell.DlLoad; m_UlLoad = cell.UlLoad; m_ROT = GetRotOnCell(cell); m_ULSuccUserNum = cell.ULSimUsers.Count; m_DLSuccUserNum = cell.AccessedUsers.Count - cell.ULSimUsers.Count; m_TotalUserNum = cell.AccessedUsers.Count; m_ULThroughPut = cell.CurUlThrouAve; m_DLThroughPut = cell.CurDlThrouAve; GetUserTypeNum(cell); }
private int GetRemainCodeNumInTs(TDSimCell tdcell) { int NotAssignedCodeNum=0; foreach (TimeSlot ts in tdcell.HSDPATimeslot) { NotAssignedCodeNum += ts.HSDPARemainCodeNum; } return NotAssignedCodeNum; }
private void ScheduleInCodeCategory(TDSimUser user, TDSimCell tdCell) { int NotAssignedCodeNum = 0; int CanAssignedCodeNum=0; CanAssignedCodeNum = GetRemainCodeNumInTs(tdCell); if (user.BearerAndResouceRatio.CodeNum > CanAssignedCodeNum) { user.FailReason = FailReason.HSDPAScheduleFailed; } else { NotAssignedCodeNum = Math.Min(CanAssignedCodeNum, user.BearerAndResouceRatio.CodeNum); foreach (TimeSlot ts in tdCell.HSDPATimeslot) { if ((ts.HSDPARemainCENum == 0)||(ts.CodeDictonary .Count >ts.HSDPAMaxTSServicedNum )) { continue; } else { if (ts.HSDPARemainCodeNum< NotAssignedCodeNum) { NotAssignedCodeNum -= ts.HSDPARemainCodeNum; ts.HSDPAConsumedCENum = ConstantParam.RUNumInOneTimeslot; ts.HSDPARemainCodeNum = 0; ts.HSDPAConsumedPower = tdCell.TxPowerPerCode * ts.HSDPAConsumedCodeNum ; ts.HSDPARemainPower = 0; ts.HSDPAScheduledUsers.Add(user); user.CodeDictonary.Add( ts.TsNum,ts.HSDPAConsumedCENum); ts.CodeDictonary.Add( user,ts.HSDPAConsumedCodeNum); } else { ts.HSDPAConsumedCENum += NotAssignedCodeNum; ts.HSDPARemainCodeNum -= NotAssignedCodeNum; ts.HSDPAConsumedPower = tdCell.TxPowerPerCode * ts.HSDPAConsumedCodeNum; ts.HSDPARemainPower -= ts.HSDPAConsumedPower; NotAssignedCodeNum = 0; ts.HSDPAScheduledUsers.Add(user); user.CodeDictonary.Add(ts.TsNum,ts.HSDPAConsumedCENum); ts.CodeDictonary.Add( user,ts.HSDPAConsumedCodeNum); } } } user.HSDPAAssignPower = tdCell.TxPowerPerCode * user.BearerAndResouceRatio.CodeNum; user.IsFirstServed = false; user.HSDPAAssignCodeNum = user.BearerAndResouceRatio.CodeNum; user.HSDPANumSlotServedPerTTI = user.CodeDictonary.Count; tdCell.HSDPAServedUserList.Add(user); user.HSDPATotalNumSlotServed += 1; } }
private void ScheduleInTsCategory(TDSimUser user, TDSimCell tdCell) { int ScheduleTsNum=0; int needAssignedNum=user .BearerAndResouceRatio .CodeNum ; foreach (TimeSlot ts in tdCell.HSDPATimeslot) { if (ts.IsTimeSlotScheduled == true)//判断时隙是否 { continue; } else { if (needAssignedNum < ConstantParam.RUNumInOneTimeslot) { ts.HSDPAConsumedCodeNum = needAssignedNum; ts.HSDPARemainCodeNum = ConstantParam.RUNumInOneTimeslot - ts.HSDPAConsumedCodeNum; ts.HSDPAConsumedPower = tdCell.TxPowerPerCode * needAssignedNum; ts.HSDPARemainPower = tdCell.HSDPAPower - ts.HSDPAConsumedPower; ts.HSDPAScheduledUsers.Add(user); user.CodeDictonary.Add(ts.TsNum, ts.HSDPAConsumedCENum); ts.CodeDictonary.Add( user,ts.HSDPAConsumedCodeNum); ts.IsTimeSlotScheduled = true; user.HSDPAAssignCodeNum += needAssignedNum; break; } else { ScheduleTsNum ++; needAssignedNum -=ConstantParam .RUNumInOneTimeslot ; ts.HSDPAConsumedCodeNum = ConstantParam.RUNumInOneTimeslot; ts.HSDPARemainCodeNum = 0; ts.HSDPAConsumedPower = tdCell.HSDPAPower; ts.HSDPARemainPower = 0; ts.HSDPAScheduledUsers.Add(user); ts.IsTimeSlotScheduled = true; ts.CodeDictonary.Add( user,ts.HSDPAConsumedCodeNum); user.CodeDictonary.Add( ts.TsNum,ts.HSDPAConsumedCENum); user.HSDPAAssignCodeNum += ConstantParam.RUNumInOneTimeslot; } } } user.IsFirstServed =false ; user.HSDPAAssignPower = tdCell.TxPowerPerCode * user.HSDPAAssignCodeNum ; user.HSDPANumSlotServedPerTTI = user.CodeDictonary.Count; user.HSDPATotalNumSlotServed += 1; tdCell.HSDPAServedUserList.Add(user) ; tdCell.HSDPARemainTSNum -= user.BearerAndResouceRatio.TsNum; }
private void JudegeScheduleCategory(TDSimUser user, TDSimCell tdCell, ref bool isCanSchedule, ref bool TsSchedule, BearerAndResouceRatio bestBearerContainer) { if (tdCell.HSDPARemainTSNum > 0) { isCanSchedule = true; TsSchedule = true; user.BearerAndResouceRatio.TsNum = Math.Min(bestBearerContainer.TsNum, tdCell.HSDPATsNum); } if ((tdCell.HSDPARemainTSNum == 0) && (m_IsCDMAon == true)) { isCanSchedule = true; TsSchedule = false; user.BearerAndResouceRatio.CodeNum = Math.Min(bestBearerContainer.CodeNum, tdCell.HSDPACodeNum); } else { } }