private void EndSession(ISession session, DateTime end, IRat rat) { if (session == null) { throw new VerticalHandoverPredictionException($"{nameof(session)} is null"); } if (rat == null) { throw new VerticalHandoverPredictionException($"{nameof(rat)} is null"); } rat.RemoveSession(session); session.SetEndTime(end); SessionId = Guid.Empty; var callLog = new CallLog { UserId = MobileTerminalId, SessionId = session.SessionId, StartTime = session.Start, Duration = session.End.Subtract(session.Start), SessionSequence = String.Join("", session.SessionSequence.Select(x => (int)x)) }; IsActive = false; AddCallLog(callLog); //if (Simulator.NetworkSimulator.Instance.SaveCallLogs) //Utils.CsvUtils._Instance.Write<CallLogMap, CallLog>(callLog, $"{Environment.CurrentDirectory}/calllogs.csv"); HetNet.Instance.TotalSessions++; }
public void AddCallLog(CallLog log) { if (log == null) { throw new VerticalHandoverPredictionException($"{nameof(log)} is invalid"); } _callLogs.Add(log); }