public void AllotResource(IDlScheduleUser user, int rbNeed) { float rbPower = DLScheduleCalaculateTool.GetRbPower(user, this.carrier); for (int i = 0; i < rbNeed; i++) { byte item = this.resource.RbList[0]; user.RbList.Add(item); this.carrier.RbDataRePower[item] = rbPower + this.carrier.RsRbPower; this.carrier.TxPower += rbPower + (((this.carrier.RsRePower * 2f) * 3f) / 11f); this.resource.RbList.RemoveAt(0); } int txNumber = SimulationTools.GetTxNum(carrier as SimulationCarrier); float num5 = SimulationTools.ConvertdBToLine(user.PowerOffsetTypeA) * this.carrier.RsRePower; float num6 = SimulationTools.ConvertdBToLine(user.PowerOffsetTypeB) * this.carrier.RsRePower; DLCarrierTag dLScheduleCarrierTag = (DLCarrierTag) this.carrier.DLScheduleCarrierTag; dLScheduleCarrierTag.TypeARemaindPower -= (num5 * 12f) * user.RbList.Count; if (txNumber == 1) { dLScheduleCarrierTag.TypeBRemaindPower -= (num6 * 10f) * user.RbList.Count; } else { dLScheduleCarrierTag.TypeBRemaindPower -= (num6 * 8f) * user.RbList.Count; } }
private bool IsCanScheduleUser(IDlScheduleUser user, int rbNeed, int rbNumByPower) { if (((base.Tag.UsableRbNumPerTti < rbNeed) || (rbNeed <= 0)) || (rbNumByPower < rbNeed)) { return false; } return true; }
private void SaveNoScheduledUser(IDlScheduleUser user, DLUserTag userTag, short tti) { SimulationUser user2 = (SimulationUser) user; if (user2.PreScheduleTime != -1) { user2.VoiceContinueLost = (short) (user2.VoiceContinueLost + 1); user2.TotalPackageLossCount = (short) (user2.TotalPackageLossCount + 1); user2.VoiceMaxContinueLost = Math.Max(user2.VoiceMaxContinueLost, user2.VoiceContinueLost); } }
private void AllotResourceForCenterUser(IDlScheduleUser user, DLUserTag userTag, int rbNeed) { int num = rbNeed - this.resource.RbCenterList.Count; this.AllotRbList(user, this.resource.RbCenterList, Math.Min(rbNeed, this.resource.RbCenterList.Count)); //如果RbCenter不够的话,就会分一些RbEdge num = Math.Min(num, this.resource.RbEdgeList.Count); if (num > 0) { this.AllotRbList(user, this.resource.RbEdgeList, num); } }
private void AllotResourceForEdgeUser(IDlScheduleUser user, DLUserTag userTag, int rbNeed) { if (this.resource.RbEdgeList.Count >= rbNeed) { this.AllotRbList(user, this.resource.RbEdgeList, rbNeed, this.IsSfSbSsSsStriNbrCarrier((IDlScheduleCarrier) user.SfSbSsSsStroNbr)); } else { this.AllotResourceWhileEdgeRbNotEnough(user, userTag, rbNeed); } }
protected void ResetUserBeforeSchedule(IDlScheduleUser user, DLUserTag userTag) { user.RbList.Clear(); user.RbgList.Clear(); user.DlMcsEff = 0f; user.MacTBS = 0f; user.State = State.Wait; userTag.RbNeed = 0; SimulationUser user2 = (SimulationUser) user; user2.RbCombineSinr = 0f; }
public void AllotResource(IDlScheduleUser user, int rbNeed) { DLUserTag dlScheduleUserTag = user.DlScheduleUserTag as DLUserTag; this.rbPower = DLScheduleCalaculateTool.GetRbPower(user, this.carrier); if (!user.IsEdgeUser) { this.AllotResourceForCenterUser(user, dlScheduleUserTag, rbNeed); } else { this.AllotResourceForEdgeUser(user, dlScheduleUserTag, rbNeed); } }
private bool ScheduleOneDataUser(IDlScheduleUser user, DLUserTag userTag, short tti) { if ((((base.Tag.UsableRbNumPerTti <= 0) || (base.Tag.MaxSchedulableDataUserNum <= 0)) || (base.Tag.TypeARemaindPower <= 0f)) || (base.Tag.TypeBRemaindPower <= 0f)) { return false; } float dLSinr = ResourceBudget.GetDLSinr(user, userTag); float mcsBySinr = DLScheduleCalaculateTool.GetMcsBySinr(user, dLSinr); if (mcsBySinr <= 0f) { return false; } float minSinr = 0f; float mimoClutterGain = 0f; SimulationTools.GetMinSinrAndMimoClutterGain(user, ref minSinr, ref mimoClutterGain, dLSinr); if (dLSinr < minSinr) { return false; } float tbs = DLScheduleCalaculateTool.CalculateTbsNeed(user, tti); int num6 = DLScheduleCalaculateTool.CalculateRBCountByTbs(user, mcsBySinr, tbs, mimoClutterGain); int num7 = DLScheduleCalaculateTool.CalaCountRBByRemaindPower(user, base.CurrentCarrier, base.Tag); int minRbNum = Math.Min(Math.Min(num6, base.Tag.UsableRbNumPerTti), SimulationConstant.DL_MAX_USER_SCHEDULE_RB_NUM); minRbNum = Math.Min(num7, minRbNum); if (minRbNum < num6) { tbs = DLScheduleCalaculateTool.CalculateTBSByMcs(user, minRbNum, mcsBySinr, mimoClutterGain); } if (tbs <= 0f) { return false; } user.MacTBS = tbs; user.DlMcsEff = mcsBySinr; user.MeasureSinr = dLSinr; user.FinalSinr = dLSinr; user.ServiceCount = (short) (user.ServiceCount + 1); user.State = State.Service; this.UpdateUserProrityGeneWithPF(user, userTag, true); base.IAllotMethod.AllotResource(user, minRbNum); base.CurrentCarrier.DlDataServiceUserList.Add(user); base.CurrentCarrier.DlDataWaitUserList.Remove(user); user.PreScheduleTime = tti; DLCarrierTag tag = base.Tag; tag.MaxSchedulableDataUserNum--; DLCarrierTag tag2 = base.Tag; tag2.UsableRbNumPerTti = (byte) (tag2.UsableRbNumPerTti - Convert.ToByte(minRbNum)); DLCarrierTag tag3 = base.Tag; tag3.TBS += tbs; return true; }
private static int Compare(IDlScheduleUser x, IDlScheduleUser y) { DLUserTag dlScheduleUserTag = x.DlScheduleUserTag as DLUserTag; DLUserTag tag2 = y.DlScheduleUserTag as DLUserTag; float num = dlScheduleUserTag.TempPriority - tag2.TempPriority; if (num > 0f) { return -1; } if (num < 0f) { return 1; } return 0; }
private void AllotDifferentCenterRbFirst(IDlScheduleUser scheduleUser, List<byte> centerRbList, List<byte> strongestNbrRbList, ref int tempNeedRbCount) { int equalsRbCount = 0; while (this.isStopSearch(tempNeedRbCount, equalsRbCount)) { byte item = this.resource.RbCenterList[equalsRbCount]; if (!strongestNbrRbList.Contains(item)) { tempNeedRbCount--; this.doAllotRbToUser(scheduleUser, centerRbList, item); } else { equalsRbCount++; } } }
private bool ScheduleVoiceUser(IDlScheduleUser user, DLUserTag userTag, short ttiNum) { if (((base.Tag.UsableRbNumPerTti > 0) && (base.Tag.TypeARemaindPower > 0f)) && (base.Tag.TypeBRemaindPower > 0f)) { float pdschSinr = user.PdschSinr; float mcsBySinr = DLScheduleCalaculateTool.GetMcsBySinr(user, pdschSinr); if (mcsBySinr <= 0f) { return false; } float minSinr = 0f; float mimoClutterGain = 0f; SimulationTools.GetMinSinrAndMimoClutterGain(user, ref minSinr, ref mimoClutterGain, pdschSinr); if (pdschSinr < minSinr) { return false; } float voicePacketSize = (user as SimulationUser).VoicePacketSize; //¸ù¾Ýtbs¼ÆËãRBÊý int rbNeed = DLScheduleCalaculateTool.CalculateRBCountByTbs(user, mcsBySinr, voicePacketSize, mimoClutterGain); int rbNumByPower = DLScheduleCalaculateTool.CalaCountRBByRemaindPower(user, base.CurrentCarrier, base.Tag); if (this.IsCanScheduleUser(user, rbNeed, rbNumByPower)) { user.MacTBS = voicePacketSize; SimulationUser user2 = (SimulationUser) user; user2.PreScheduleTime = ttiNum; user.ServiceCount = (short) (user.ServiceCount + 1); user.MeasureSinr = pdschSinr; user.FinalSinr = pdschSinr; user.DlMcsEff = mcsBySinr; user2.VoiceContinueLost = 0; user.PreScheduleTime = ttiNum; userTag.RbNeed = rbNeed; user.State = State.Service; base.CurrentCarrier.DlVoiceServiceUserList.Add(user); base.CurrentCarrier.DlVoiceWaitUserList.Remove(user); DLCarrierTag tag = base.Tag; tag.UsableRbNumPerTti = (byte) (tag.UsableRbNumPerTti - Convert.ToByte(rbNeed)); return true; } } return false; }
private void AllotRbList(IDlScheduleUser scheduleUser, List<byte> rbList, int allotCount, bool desc) { if (!desc) { while (allotCount > 0) { this.doAllotRbToUser(scheduleUser, rbList, rbList[rbList.Count - 1]); allotCount--; } } else { while (allotCount > 0) { this.doAllotRbToUser(scheduleUser, rbList, rbList[0]); allotCount--; } } }
private void AssortScheduledUser(IDlScheduleUser user, DLUserTag userTag, short tti, BaseUserList lessAveRateGBRUserList, BaseUserList lessMinRateNGBRUserList, BaseUserList satisfiedGBRUserList, BaseUserList satisfiedNGBRUserList) { LTEService service2 = SimulationTools.GetUnionPsService(user.LTEUser.Service).PSServiceDic[NetWorkType.LTE] as LTEService; if (service2.IsGBR) { float num = this.ReduceRate(user, tti); if (base.GetActualBusinessBitRate(user, tti) < num) { lessAveRateGBRUserList.AddUser(user, userTag); } else { satisfiedGBRUserList.AddUser(user, userTag); } } else if (base.GetActualBusinessBitRate(user, tti) < user.DlMacMinThroughputDemand) { lessMinRateNGBRUserList.AddUser(user, userTag); } else { satisfiedNGBRUserList.AddUser(user, userTag); } }
private void AllotResourceWhileEdgeRbNotEnough(IDlScheduleUser user, DLUserTag userTag, int rbNeed) { int allotCount = rbNeed - this.resource.RbEdgeList.Count; this.AllotRbList(user, this.resource.RbEdgeList, this.resource.RbEdgeList.Count); if (user.SfSbStroNbr == null) { this.AllotRbList(user, this.resource.RbCenterList, allotCount, true); } else { this.AllotResourceWhileSfSbStroNbrNotNull(user, userTag, allotCount); } }
private float ReduceRate(IDlScheduleUser user, short tti) { float dlMacMinThroughputDemand = user.DlMacMinThroughputDemand; if (user.IsEdgeUser) { dlMacMinThroughputDemand = user.DlMacMinThroughputDemand * user.BestServiceCarrier.DlGBRUserPriorityDic[user.LTEUser.Priority]; if ((user.BestServiceCarrier.DlGBRUserPriorityDic[user.LTEUser.Priority] != 1f) && (user.DlGBRDegrateTTI <= 0)) { user.DlGBRDegrateTTI = tti; } } return dlMacMinThroughputDemand; }
public abstract float GetPriority(IDlScheduleUser user, DLUserTag usertag);
private void SaveNoScheduleUser(IDlScheduleUser user, DLUserTag usertag, short tti) { this.UpdateUserProrityGeneWithPF(user, usertag, false); }
private void AllotRbList(IDlScheduleUser scheduleUser, List<byte> rbList, int allotCount) { this.AllotRbList(scheduleUser, rbList, allotCount, true); }
private void RobCenterRbNotEqualNbrEdgeRb(IDlScheduleUser scheduleUser, List<byte> centerRbList, int centerNeedRbCount) { int tempNeedRbCount = centerNeedRbCount; if (!scheduleUser.SfSbStroNbr.IsDlIcicOn) { this.AllotRbList(scheduleUser, centerRbList, centerNeedRbCount); } else { List<byte> carrierOrignalRBList = ResourceBudget.GetCarrierOrignalRBList(scheduleUser.SfSbStroNbr); this.AllotDifferentCenterRbFirst(scheduleUser, centerRbList, carrierOrignalRBList, ref tempNeedRbCount); this.AllotRbList(scheduleUser, centerRbList, tempNeedRbCount); } }
private void UpdateUserProrityGeneWithPF(IDlScheduleUser user, DLUserTag userTag, bool scheduled) { if (base.Policy == SchedulePolicy.PF) { if (scheduled) { userTag.PriorityGene = (0.999f * userTag.PriorityGene) + ((0.001f * user.MacTBS) * 1000f); } else { userTag.PriorityGene = 0.999f * userTag.PriorityGene; } } }
public abstract void AddUser(IDlScheduleUser user, DLUserTag usertag);
public override float GetPriority(IDlScheduleUser user, DLUserTag usertag) { int servicePriority = SimulationTools.GetServicePriority(user.LTEUser.Service); return ((user.LTEUser.Priority * servicePriority) * (user.DlRsSinr - user.BestServiceCarrier.DLRsSinrAccessThreshold)); }
private void AllotResourceWhileSfSbStroNbrNotNull(IDlScheduleUser user, DLUserTag userTag, int centerNeedRbCount) { if (user.SfSbSsSsStroNbr == null) { this.RobCenterRbNotEqualNbrEdgeRb(user, this.resource.RbCenterList, centerNeedRbCount); } else { this.AllotRbList(user, this.resource.RbCenterList, centerNeedRbCount, this.isHighCarrier((IDlScheduleCarrier) user.SfSbStroNbr)); } }
public static void GetMinSinrAndMimoClutterGain(IDlScheduleUser user, ref float minSinr, ref float mimoClutterGain, float pdschSinr) { SimulationUser user2 = user as SimulationUser; if (user2.IsAmsSupported) { bool flag = pdschSinr > user2.BestServiceCarrier.AmsThreshold; mimoClutterGain = flag ? user.MIMOClutterGain : user.SfbcMimoClutterGain; minSinr = flag ? user.MinMcsToSinr[0] : user.MinMcsToSinr[1]; } else { minSinr = user.MinMcsToSinr[0]; mimoClutterGain = user.MIMOClutterGain; } }
private void doAllotRbToUser(IDlScheduleUser scheduleUser, List<byte> rbList, byte rb) { scheduleUser.RbList.Add(rb); this.carrier.RbDataRePower[rb] = this.rbPower + this.carrier.RsRbPower; this.carrier.TxPower += this.rbPower + (((this.carrier.RsRePower * 2f) * 3f) / 11f); rbList.Remove(rb); int txNumber = SimulationTools.GetTxNum(carrier as SimulationCarrier); float num2 = SimulationTools.ConvertdBToLine(scheduleUser.PowerOffsetTypeA) * this.carrier.RsRePower; float num3 = SimulationTools.ConvertdBToLine(scheduleUser.PowerOffsetTypeB) * this.carrier.RsRePower; DLCarrierTag dLScheduleCarrierTag = (DLCarrierTag) this.carrier.DLScheduleCarrierTag; dLScheduleCarrierTag.TypeARemaindPower -= num2 * 12f; if (txNumber == 1) { dLScheduleCarrierTag.TypeBRemaindPower -= num3 * 10f; } else { dLScheduleCarrierTag.TypeBRemaindPower -= num3 * 8f; } }