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); }
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); } }
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); }
/// <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); }
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); }
public float GetFastFadingdB(ISimCellBase cell, ISimUser user, LinkType type) { return 110; }