public void CalcInterfereVale_Test()
        {
            InterfereCalculator interfereCalculator = new InterfereCalculator();
            IGetLinkloss linkLoss = new MockIGetLinkloss();
            IInterfCalc interfCalc = new MockIInterfCalc();
            ISmartAntCalcGain smartAntCalcGain = new MockISmartAntCalcGain();

            interfereCalculator.Initialization(linkLoss, interfCalc, smartAntCalcGain);

            TDSimUser user;
            user = MockDPAUser.CreatTDSimUser_CS();

            TDSimUser user1;
            user1 = MockDPAUser.CreatTDSimUser_CS();
            TDSimUser user2;
            user2 = MockDPAUser.CreatTDSimUser_CS();
            TDSimUser userR4;
            userR4 = MockDPAUser.CreatTDSimUser_CS();

            TS timeSlot = new TS();
            TDSimCell tdCell;
            tdCell = MockCell.CreatTDSimCell();
            TDSimCell tdInterCell;
            tdInterCell = MockCell.CreatTDSimCell();
            tdInterCell.NeCell.FreqBand.DLFrequency = 1900f;

            user.ServiceCell.TDIntefCells.Add(tdCell);
            user.ServiceCell.TDIntefCells.Add(tdInterCell);

            tdCell.Slots[(int)timeSlot].HSDPAScheduledUsers.Add(user1);
            tdCell.Slots[(int)timeSlot].AccessedUsers.Add(userR4);

            tdInterCell.Slots[(int)timeSlot].HSDPAScheduledUsers.Add(user1);
            tdInterCell.Slots[(int)timeSlot].AccessedUsers.Add(userR4);

            user.ServiceCell.Slots[(int)timeSlot].HSDPAScheduledUsers.Add(user1);
            user.ServiceCell.Slots[(int)timeSlot].HSDPAScheduledUsers.Add(user2);

            user.ServiceCell.Slots[(int)timeSlot].AccessedUsers.Add(userR4);

            //ISimCellBase GSMCell = new MockISimCellBase();
            //GSMCell.Cell.FreqBand = new FrequencyBand();
            //GSMCell.Cell.FreqBand.BandWidth = 10000;
            //ISimCellBase UMTSCell = new MockISimCellBase();
            //UMTSCell.Cell.FreqBand = new FrequencyBand();
            //UMTSCell.Cell.FreqBand.BandWidth = 20000;
            //List<ISimCellBase> GSMInterf = new List<ISimCellBase>();
            //List<ISimCellBase> UMTSInterf = new List<ISimCellBase>();
            //GSMInterf.Add(GSMCell);
            //UMTSInterf.Add(UMTSCell);

            //user.ServiceCell.GSMIntefCells = GSMInterf;
            //user.ServiceCell.UMTSIntefCells = UMTSInterf;

            Assert.AreEqual((int)(interfereCalculator.CalcInterfereVale(user, timeSlot)), 3.0);
        }
Exemple #2
0
        public void HARQ_Test()
        {
            IGetLinkloss linkloss = new MockIGetLinkloss();
            ICalcInterfere interfere = null;
            TDCalcCommonParam param = new TDCalcCommonParam();
            TDLinkLossCalc TDLinkLoss = new TDLinkLossCalc(linkloss);
            ISimUser simUser = new MockISimUserBase();
            ISimCellBase cellBase = new MockISimCellBase();
            TDLinkLoss.GetDLTotalLoss(simUser, cellBase);

            HSDPABearerManagement retainGain = new HSDPABearerManagement(NetWorkType.TDSCDMA);
            HARQ m_Harq = new HARQ(interfere, linkloss, retainGain);
            m_Harq.CalcInterfere = new MockICalcInterfere();
            TimeSlot slot1 = new TimeSlot();
            TimeSlot slot2 = new TimeSlot();
            List<TDSimCell> cellList = new List<TDSimCell>();
            TDSimCell cell1;
            cell1 = MockTDSimCell.CreatTDSimCell();
            //cell1.NeCell = new TDSCDMACarrier();
            TDSimCell cell2;
            cell2 = MockTDSimCell.CreatTDSimCell();
            //cell2.NeCell = new TDSCDMACarrier();

            TDSimUser user1;
            user1 = MockTDSimUser.CreatTDSimUser_CS();
            TDSimUser user2;
            user2 = MockTDSimUser.CreatTDSimUser_CS();
            user2.IsHSDPARetransmited = true;
            user2.HSDPARetransCount = 1;
            TDSimUser user3;
            user3 = MockTDSimUser.CreatTDSimUser_CS();
            user3.IsHSDPARetransmited = true;
            user3.HSDPARetransCount = 2;
            slot1.HSDPAScheduledUsers.Add(user1);
            slot2.HSDPAScheduledUsers.Add(user2);
            slot2.HSDPAScheduledUsers.Add(user3);


            cell1.HSDPATimeslot.Add(slot1);
            cell1.HSDPATimeslot.Add(slot2);

            cellList.Add(cell1);
            cellList.Add(cell2);


            m_Harq.Run(cellList);

            Assert.AreEqual(cellList[0].HSDPAAccessedUsers.Count, 0);

        }
        public void GetSmartAntSideGain_Test()
        {

            TDSimUser curUser;
            curUser = MockDPAUser.CreatTDSimUser_CS();
            TDSimUser infUser;
            infUser = MockDPAUser.CreatTDSimUser_CS();
            InterfereCalculator interfereCalculator = new InterfereCalculator();
            IGetLinkloss linkLoss = new MockIGetLinkloss();
            IInterfCalc interfCalc = new MockIInterfCalc();
            ISmartAntCalcGain smartAntCalcGain = new MockISmartAntCalcGain();
            interfereCalculator.Initialization(linkLoss, interfCalc, smartAntCalcGain);

            float sideGain = interfereCalculator.GetSmartAntSideGain(curUser, infUser);
            Assert.AreEqual(sideGain, 11f);
        }
        public void Run_Test()
        {
            HSDPASimulization simulization = new HSDPASimulization();
            TDIterationBase tdIterationBase = new TDIteration();

            SnapshotContext context = new SnapshotContext();
            List<Transceiver> trans = new List<Transceiver>();
            TDSimCellCollection cellCollection = new TDSimCellCollection();

            TDSimCell cell;
            cell = MockTDSimCell.CreatTDSimCell();

            simulization.AccessControl = new Access();
            simulization.SimulizeTTICount = 50;

            IGetLinkloss linkloss = new MockIGetLinkloss();
            ICalcInterfere interfere = null;
            TDCalcCommonParam param = new TDCalcCommonParam();
            TDLinkLossCalc TDLinkLoss = new TDLinkLossCalc(linkloss);
            ISimUser simUser = new MockISimUserBase();
            ISimCellBase cellBase = new MockISimCellBase();
            TDLinkLoss.GetDLTotalLoss(simUser, cellBase);
            HSDPABearerManagement retainGain = new HSDPABearerManagement(NetWorkType.TDSCDMA);
            HARQ m_Harq = new HARQ(interfere, linkloss, retainGain);
            simulization.HarqArithmetic = new HARQ(interfere, linkloss, retainGain);
            simulization.HarqArithmetic.CalcInterfere = new MockICalcInterfere();

            SortUser sortUserTool = new SortUser();
            ICalcInterfere cInterfere = new MockICalcInterfere();
            TDCalcCommonParam m_CommonParam = new TDCalcCommonParam();
            List<TDHSDPABearer> bearerList = new List<TDHSDPABearer>();
            TDHSDPABearer bearer1 = new TDHSDPABearer();
            TDHSDPABearer bearer2 = new TDHSDPABearer();
            bearer1.RTBS = 50;
            bearer2.RTBS = 50;
            bearer2.CI = 2d;
            bearerList.Add(bearer1);
            bearerList.Add(bearer2);
            m_CommonParam.CalcLinkLoss = new MockIGetLinkloss();
            simulization.ResourceSchedule = new ResourceSchedule(sortUserTool, cInterfere, m_CommonParam, bearerList);
            simulization.SortUserTool = new SortUser();

            TDSimCell cell1;
            cell1 = MockTDSimCell.CreatTDSimCell();
            TDSimCell cell2;
            cell2 = MockTDSimCell.CreatTDSimCell();
            TDSimUser user3;
            user3 = MockTDSimUser.CreatTDSimUser_CS();
            TDSimUser user4;
            user4 = MockTDSimUser.CreatTDSimUser_CS();
            TDSimUser user1;
            user1 = MockTDSimUser.CreatTDSimUser_CS();
            user1.HSDPAThrowput = 100f;
            user1.IsHSDPARetransmited = true;
            TDSimUser user2;
            user2 = MockTDSimUser.CreatTDSimUser_PS();
            user2.HSDPAThrowput = 200f;
            cell2.HSDPAServedUserList.Add(user3);
            cell2.HSDPAServedUserList.Add(user4);
            cell2.HSDPAServedUserCount = 2;
            cell1.HSDPATimeslot[0].HSDPAScheduledUsers.Add(user1);
            cell1.HSDPATimeslot[0].HSDPAScheduledUsers.Add(user2);
            cell1.HSDPAAccessedUsers.Add(user1);
            cell1.HSDPAAccessedUsers.Add(user2);
            List<TDSimCell> cellList = new List<TDSimCell>();
            cellList.Add(cell1);
            cellList.Add(cell2);
            List<TDSimUser> userList = new List<TDSimUser>();
            userList.Add(user1);
            userList.Add(user2);
            simulization.TimeSlotSimulization = new TimeSlotSim(cellList, userList);

            cellCollection.TDCells.Add(cell1);
            cellCollection.TDCells.Add(cell2);

            context.AddKey(ContextKeys.TranceiverList, trans);
            context.AddKey(ContextKeys.TDSimCellCollection, cellCollection);

            simulization.InitCells(context);
            simulization.SimResultReport();

            DPAResult dpaResult =(DPAResult)simulization.Run();
            Assert.AreEqual(dpaResult.CellResult.Count, 2);
        }