예제 #1
0
 private static void UpdateNearestCell(ISimUser user, ref ISimCellBase nearestCell, ref float minDistance, ISimCellBase cellBase)
 {
     GeoXYPoint trancXY = new GeoXYPoint(cellBase.X, cellBase.Y);
     GeoXYPoint userXY = new GeoXYPoint(user.X, user.Y);
     GeoXYLine trancToUser = new GeoXYLine(trancXY, userXY);
     FindNearestCell(ref nearestCell, ref minDistance, cellBase, trancToUser);
 }
예제 #2
0
 private static void CalcNearestCell(ISimUser user, ref ISimCellBase nearestCell, ref float minDistance, ISimCellBase cellBase)
 {
     bool isUserNear = IsUserNear(user, cellBase);
     if (!isUserNear)
     {
         UpdateNearestCell(user, ref nearestCell, ref minDistance, cellBase);
     }
 }
예제 #3
0
 public float GetFastFadingdB(ISimCellBase carrier, ISimUser user, LinkType type)
 {
     float speed = user.TrafficUser.Mobility.MeanSpeed;            
     float frequency = (float)(carrier.Cell.FreqBand.DLFrequency * 1e6);
     //ChannelTypeManage CTManage = new ChannelTypeManage();
     //CTManage.GetChannelTypeInfo();
     ChannelType CT = m_CTManage.SpeedChannelDic[speed];
     ChannelModel CM = new ChannelModel(CT.ChannelPath, speed, frequency);
     CalcFastFading calc = new CalcFastFading(10);
     return  calc.GetFastFadingdB(CM, m_TimeSpan);            
 }      
예제 #4
0
 /// <summary>
 /// 计算ISimCellBase集合中距离User最近的一个
 /// </summary>
 /// <param name="user">用户</param>
 /// <param name="trans">Tranceiver集合</param>
 /// <param name="nearestTran">最近Tranceiver</param>
 public static ISimCellBase CalcUserNearestOneNetTran(ISimUser user, List<ISimCellBase> cells)
 {
     ISimCellBase nearestCell = null;
     float minDistance = float.MaxValue;
     foreach (ISimCellBase cellBase in cells)
     {
         CalcNearestCell(user, ref nearestCell, ref minDistance, cellBase);
         //if (IsUserNear(user, cellBase))
         //{
         //    continue;
         //}
         
     }
    return  CheckNearestCell(cells, nearestCell);          
 }
예제 #5
0
 private static bool IsUserNear(ISimUser user, ISimCellBase cellBase)
 {
     bool isUserXNear = Math.Abs(user.X - cellBase.X) > GetCalcRadius(cellBase);
     bool isUserYNear =  Math.Abs(user.Y - cellBase.Y) > GetCalcRadius(cellBase);
     return (isUserXNear || isUserYNear);
 }
예제 #6
0
파일: MockContext.cs 프로젝트: xiaoyj/Space
 public float GetFastFadingdB(ISimCellBase cell, ISimUser user, LinkType type)
 {
     return 110;
 }