Esempio n. 1
0
 public Link(SerializationInfo info, StreamingContext context)
 {
     Number                 = (int)info.GetValue("Number", typeof(int));
     Receiver               = (int)info.GetValue("Receiver", typeof(int));
     Transmitter            = (int)info.GetValue("Transmitter", typeof(int));
     Channel_gain           = (double)info.GetValue("Channel Gain", typeof(double));
     Distance               = (double)info.GetValue("Distance", typeof(double));
     SecondaryQLTable       = (List <SecondaryQLPair>)info.GetValue("Secondary Q Table", typeof(List <SecondaryQLPair>));
     Occupy                 = false;
     ActivitedTime          = 0;
     CurrentSecondaryAction = new SecondaryAction();
     LastSecondaryAction    = new SecondaryAction();
 }
Esempio n. 2
0
 public Link()
 {
     Receiver               = new int();
     Transmitter            = new int();
     Number                 = new int();
     Distance               = new double();
     Channel_gain           = new double();
     SecondaryQLTable       = new List <SecondaryQLPair>();
     Occupy                 = false;
     ActivitedTime          = 0;
     CurrentSecondaryAction = new SecondaryAction();
     LastSecondaryAction    = new SecondaryAction();
 }
        public SecondaryQLPair(Node n, List <Boolean> CurrentSecondarySystemState)
        {
            SystemState          = CurrentSecondarySystemState.ToList();
            SecondaryActionSpace = new List <SecondaryAction>();

            double[] DataRates = new double[9] {
                0, 6, 9, 12, 18, 24, 36, 48, 54
            };
            for (int i = 0; i <= 8; i++)
            {
                SecondaryAction a = new SecondaryAction();
                a.DataRate   = DataRates[i] * 1000 / 8;
                a.SecondaryQ = 0;
                SecondaryActionSpace.Add(a);
            }
        }
Esempio n. 4
0
        public Link(Node transmitter, Node receiver)
        {
            Receiver    = receiver.Number;
            Transmitter = transmitter.Number;
            transmitter.Links.Add(this);
            Number   = transmitter.Links.Count - 1;
            Distance = CalculateDistance(transmitter, receiver);
            double l_0 = transmitter.Transmit_Antenna_Gain * receiver.Receive_Antenna_Gain * Math.Pow((LightSspeed / (4 * Frequency * Math.PI * 1)), 2);
            double pt  = 0.1;
            double pr  = 0.1 * l_0;
            double L_0 = 10 * Math.Log10(pt / pr);
            double c_0 = Math.Pow(1, 2) * Math.Pow(10, (-L_0 / 10));
            double F_g = 1;

            Channel_gain           = (c_0 * F_g) / (Math.Pow((CalculateDistance(transmitter, receiver)), 2));
            SecondaryQLTable       = new List <SecondaryQLPair>();
            Occupy                 = false;
            ActivitedTime          = 0;
            CurrentSecondaryAction = new SecondaryAction();
            LastSecondaryAction    = new SecondaryAction();
        }