public void Init(SnapshotContext context) { m_GetLinkLoss = context.Lookup<IGetLinkloss>(GsmContextkey.GSMGetLinkloss); m_InterfCalc = context.Lookup<IInterfCalc>(GsmContextkey.GSMIInterfCalc); m_InterfPara = context.Lookup<InterfCalcPara>(GsmContextkey.GSMIInterfParam); m_ForAccessAgain = context.Lookup<List<GSMSimUser>>(GsmContextkey.GSMForAccessAgain); m_ServerUser = context.Lookup<List<GSMSimUser>>(GsmContextkey.GSMServedUsers); m_TchCir = new TCHCIR(m_GetLinkLoss, m_InterfPara, m_InterfCalc); m_ThrptCalc = new ThroughputCalculate(); context.AddKey(GsmContextkey.KickedUsers, m_KickedUsers); m_CsTable = context.Lookup<CodeSchemeTable>(GsmContextkey.CodeSchemeTable); }
/// <summary> /// 仿真器其它初始化工作 /// </summary> /// <param name="context"></param> private void SnapshotInit(SnapshotContext context) { FailedThreshold thresold = context.Lookup<FailedThreshold>(ContextKeys.FailedThreshold); FailNumThreshold = thresold.Threshold; //获得用户集合 m_GSMPreAccessUsers = context.Lookup<List<User>>(ContextKeys.PreAccessUsers); //m_GSMFailAccessUsers = context.Lookup<List<User>>(ContextKeys.AccessFailedUsers); m_AppContext = context.Lookup<IApplicationContext>(ContextKeys.AppContext); m_GSMGetLinkLoss = context.Lookup<IGetLinkloss>(ContextKeys.IGetLinkloss); m_GSMContext.AddKey(GsmContextkey.GSMGetLinkloss, m_GSMGetLinkLoss); m_UIParam = context.Lookup<GSMUIParam>(ContextKeys.GSMUIParam); m_GSMContext.AddKey(GsmContextkey.GSMUIParam, m_UIParam); InitCalcPara(); m_GSMContext.AddKey(GsmContextkey.GSMIInterfParam, m_InterfCalcPara); m_InterfCalc = context.Lookup<IInterfCalc>(ContextKeys.IIterfCalc); m_GSMContext.AddKey(GsmContextkey.GSMIInterfCalc, m_InterfCalc); //初始化CodeSchemeTable TrafficAdaptorAssist taa = TrafficAdaptorAssist.Instance; List<GSMCodeSchemeModel> gSMBearer = taa.GSMCodeSchemeList; m_CSTable = new CodeSchemeTable(gSMBearer); m_GSMContext.AddKey(GsmContextkey.CodeSchemeTable, m_CSTable); //初始化接入控制 m_GSMContext.AddKey(GsmContextkey.Access, m_Access); m_Access.Init(m_GSMContext); m_LoadStatus.Init(context); context.AddKey(ContextKeys.GSMLoadStatus, m_LoadStatus); m_GSMContext.AddKey(GsmContextkey.AllUsers, m_GSMSimUserList); m_GSMContext.AddKey(GsmContextkey.GSMForAccess, m_GSMForAccess); }
public void Initial() { m_ServedUser = new List<GSMSimUser>(); m_ForAccessAgain = new List<GSMSimUser>(); m_Context = GSMMock.CreateContext(); TrafficAdaptorAssist trafficAdaptor = TrafficAdaptorAssist.Instance; m_CodeSchemeTable = new CodeSchemeTable(trafficAdaptor.GSMCodeSchemeList); m_Context.AddKey(GsmContextkey.GSMForAccessAgain, m_ForAccessAgain); m_Context.AddKey(GsmContextkey.GSMServedUsers, m_ServedUser); m_Context.AddKey(GsmContextkey.CodeSchemeTable, m_CodeSchemeTable); GSMSimUser userOne = GSMMock.MockGsmSimUser(); userOne.IsCs = true; GSMSimUser userTwo = GSMMock.MockGsmSimUser(); userTwo.IsCs = true; GSMSimUser userThr = GSMMock.MockGsmPsSimUser(); userThr.IsCs = false; GSMSimUser userFor = GSMMock.MockGsmPsSimUser(); userFor.IsCs = false; m_ServedUser.Add(userOne); m_ServedUser.Add(userTwo); m_ServedUser.Add(userThr); m_ServedUser.Add(userFor); m_ServedUser[0].TrafficUser.LinkType = LinkType.Uplink; m_ServedUser[1].TrafficUser.LinkType = LinkType.Downlink; m_ServedUser[2].TrafficUser.LinkType = LinkType.Uplink; m_ServedUser[3].TrafficUser.LinkType = LinkType.Downlink; m_TRX = GSMMock.MockGsmSimTrx(); for (int i = 1; i < 4; i++) { m_TRX.TSs[i].NETimeSlot.ChanType = Huawei.UNet.NE.Interface.ChannelType.PDCH; m_TRX.TSs[i].UlChanType = Huawei.UNet.NE.Interface.ChannelType.PDCH; m_TRX.TSs[i].DlChanType = Huawei.UNet.NE.Interface.ChannelType.PDCH; } for (int i = 4; i < 8; i++) { m_TRX.TSs[i].NETimeSlot.ChanType = Huawei.UNet.NE.Interface.ChannelType.TCH; m_TRX.TSs[i].UlChanType = Huawei.UNet.NE.Interface.ChannelType.TCH; m_TRX.TSs[i].DlChanType = Huawei.UNet.NE.Interface.ChannelType.TCH; } m_TRX.TSs[4].DLMsColl.Add(m_ServedUser[1]); m_TRX.TSs[2].DLMsColl.Add(m_ServedUser[3]); m_TRX.TSs[3].DLMsColl.Add(m_ServedUser[3]); m_TRX.TSs[5].ULMsColl.Add(m_ServedUser[0]); m_TRX.TSs[2].ULMsColl.Add(m_ServedUser[2]); m_TRX.TSs[3].ULMsColl.Add(m_ServedUser[2]); m_TRX.TSs[1].ULMsColl.Add(m_ServedUser[2]); m_ServedUser[0].UlTs.Add(m_TRX.TSs[5]); m_ServedUser[1].DlTs.Add(m_TRX.TSs[4]); m_ServedUser[2].UlTs.Add(m_TRX.TSs[1]); m_ServedUser[2].UlTs.Add(m_TRX.TSs[2]); m_ServedUser[2].UlTs.Add(m_TRX.TSs[3]); m_ServedUser[3].DlTs.Add(m_TRX.TSs[2]); m_ServedUser[3].DlTs.Add(m_TRX.TSs[3]); foreach (GSMSimUser user in m_ServedUser) { GSMTerminal gsmTerminal = new GSMTerminal(); gsmTerminal.NetType = NetWorkType.GSM; Terminal terminal = new Terminal(); terminal.Technology = NetWorkType.GSM; terminal.NetTerminalList.Add(gsmTerminal); user.TrafficUser.Terminal = terminal; } }