public Node(SerializationInfo info, StreamingContext context) { X = (int)info.GetValue("X", typeof(int)); Y = (int)info.GetValue("Y", typeof(int)); Number = (int)info.GetValue("Number", typeof(int)); Transmission_Power = (double)info.GetValue("Transmission Power", typeof(double)); Transmit_Antenna_Gain = (double)info.GetValue("Transmit Antenna Gain", typeof(double)); Receive_Antenna_Gain = (double)info.GetValue("Receive Antenna Gain", typeof(double)); Neightbors = (List <int>)info.GetValue("Neighbors", typeof(List <int>)); //Buffer = (List<Package>)info.GetValue("Buffer", typeof(List<Package>)); Links = (List <Link>)info.GetValue("Buffer", typeof(List <Link>)); PrimaryQLTable = (List <PrimaryQLPair>)info.GetValue("Primary Q Table", typeof(List <PrimaryQLPair>)); IsReady = true; IsTransmitting = false; IsReceiving = false; IsSuccessful = true; WaitingTimer = new double(); Iterations = new int(); SlotLength = new double(); CurrentSystemState = new List <Boolean>(); LastSystemState = new List <Boolean>(); CurrentPrimaryAction = new PrimaryAction(); PrimaryChosenGreedy = false; PrimaryChosenGreedy = false; PrimaryTotalReward = new double(); Primaryp_k = new double(); PrimaryTotalTime = new double(); SecondaryChosenGreedy = false; SecondaryTotalReward = new double(); Secondaryp_k = new double(); SecondaryTotalTime = new double(); BackoffCounter = new int(); }
public Node() { X = new int(); Y = new int(); Number = new int(); Transmission_Power = new double(); Transmit_Antenna_Gain = Math.Pow(10, 0.1); Receive_Antenna_Gain = Math.Pow(10, 0.1); Links = new List <Link>(); Buffer = new List <Package>(); Neightbors = new List <int>(); PrimaryQLTable = new List <PrimaryQLPair>(); IsReady = true; IsTransmitting = false; IsReceiving = false; IsSuccessful = true; WaitingTimer = new double(); Iterations = new int(); SlotLength = new double(); CurrentSystemState = new List <Boolean>(); LastSystemState = new List <Boolean>(); CurrentPrimaryAction = new PrimaryAction(); PrimaryChosenGreedy = false; PrimaryTotalReward = new double(); Primaryp_k = new double(); PrimaryTotalTime = new double(); SecondaryChosenGreedy = false; SecondaryTotalReward = new double(); Secondaryp_k = new double(); SecondaryTotalTime = new double(); BackoffCounter = new int(); }
public PrimaryQLPair(Node n, List <Boolean> CurrentSystemState) { SystemState = CurrentSystemState.ToList(); PrimaryActionSpace = new List <PrimaryAction>(); foreach (Link l in n.Links) { PrimaryAction a = new PrimaryAction(); a.Chosen_Link = l.Number; a.PrimaryQ = 0; PrimaryActionSpace.Add(a); } }