Ejemplo n.º 1
0
    // Start is called before the first frame update
    void Start()
    {
        GameObject LookUpT = GameObject.Find("LookUpTables");
        LookUpTableGen LUT_Script = LookUpT.GetComponent<LookUpTableGen>();
        GlobeCom2 = LUT_Script.GC2; // coordinates, normals, distances, departing and arriving angles
        GlobeCom3 = LUT_Script.GC3; // coordinates, normals, distances, departing and arriving angles

        GameObject MPC_Spawner = GameObject.Find("Direct_Solution");
        Correcting_polygons MPC_Script = MPC_Spawner.GetComponent<Correcting_polygons>();
        MPC1 = MPC_Script.SeenV6_MPC1;
        MPC2 = MPC_Script.SeenV6_MPC2;
        MPC3 = MPC_Script.SeenV6_MPC3;

        // assigning sripts names to the Tx and Rx
        Tx_Seen_MPC_Script = Tx.GetComponent<Transceiver_Channel>();
        Rx_Seen_MPC_Script = Rx.GetComponent<Transceiver_Channel>();
    }
Ejemplo n.º 2
0
    // Start is called before the first frame update
    void Start()
    {
        /// for Fourier transform

        X_inputValues = new double[Nfft];
        for (int i = 0; i < Nfft; i++)
        {
            X_inputValues[i] = i;
        }

        // ground reflection
        Z = (float)Math.Sqrt(RelativePermitivity - 1);

        // finding the script
        GameObject     LookUpT    = GameObject.Find("LookUpTables");
        LookUpTableGen LUT_Script = LookUpT.GetComponent <LookUpTableGen>();


        // reading info about MPC2
        LinearGlobeCom2          = LUT_Script.Linear_GC2;
        IndexesGlobeCom2         = LUT_Script.Indexes_GC2;
        MaxLengthOfSeenMPC2Lists = LUT_Script.MaxLengthOfSeenMPC2Lists;

        flag_LoS = 0; // flag will be needed for the edge effect

        // test allocation nativearrays
        LookUpTable2   = new NativeArray <GeoComp>(LinearGlobeCom2.Count, Allocator.Persistent);
        LookUpTable2ID = new NativeArray <Vector2Int>(IndexesGlobeCom2.Count, Allocator.Persistent);

        for (int i = 0; i < LinearGlobeCom2.Count; i++)
        {
            LookUpTable2[i] = LinearGlobeCom2[i];
        }
        for (int i = 0; i < IndexesGlobeCom2.Count; i++)
        {
            LookUpTable2ID[i] = IndexesGlobeCom2[i];
        }

        // reading info about MPC3
        LinearGlobeCom3          = LUT_Script.Linear_GC3;
        IndexesGlobeCom3         = LUT_Script.Indexes_GC3;
        MaxLengthOfSeenMPC3Lists = LUT_Script.MaxLengthOfSeenMPC3Lists;

        LookUpTable3   = new NativeArray <GeoComp>(LinearGlobeCom3.Count, Allocator.Persistent);
        LookUpTable3ID = new NativeArray <Vector2Int>(IndexesGlobeCom3.Count, Allocator.Persistent);

        for (int i = 0; i < LinearGlobeCom3.Count; i++)
        {
            LookUpTable3[i] = LinearGlobeCom3[i];
        }
        for (int i = 0; i < IndexesGlobeCom3.Count; i++)
        {
            LookUpTable3ID[i] = IndexesGlobeCom3[i];
        }
        // test allocation nativearrays



        GameObject          MPC_Spawner = GameObject.Find("Direct_Solution");
        Correcting_polygons MPC_Script  = MPC_Spawner.GetComponent <Correcting_polygons>();

        MPC1 = MPC_Script.SeenV6_MPC1;
        MPC2 = MPC_Script.SeenV6_MPC2;
        MPC3 = MPC_Script.SeenV6_MPC3;

        SeenMPC1Table = new NativeArray <V6>(MPC1.Count, Allocator.Persistent);
        for (int i = 0; i < MPC1.Count; i++)
        {
            SeenMPC1Table[i] = MPC1[i];
        }

        SeenMPC2Table = new NativeArray <V6>(MPC2.Count, Allocator.Persistent);
        for (int i = 0; i < MPC2.Count; i++)
        {
            SeenMPC2Table[i] = MPC2[i];
        }

        SeenMPC3Table = new NativeArray <V6>(MPC3.Count, Allocator.Persistent);
        for (int i = 0; i < MPC3.Count; i++)
        {
            SeenMPC3Table[i] = MPC3[i];
        }

        // assigning sripts names to the Tx and Rx
        Tx_Seen_MPC_Script = Tx.GetComponent <Transceiver_Channel>();
        Tx_Antenna_pattern = Tx_Seen_MPC_Script.Antenna_pattern;
        Rx_Seen_MPC_Script = Rx.GetComponent <Transceiver_Channel>();
        Rx_Antenna_pattern = Rx_Seen_MPC_Script.Antenna_pattern;
    }
Ejemplo n.º 3
0
    // Start is called before the first frame update
    void Start()
    {
        /// for Fourier transform
        X_inputValues = new double[H.Length];
        for (int i = 0; i < H.Length; i++)
        {
            X_inputValues[i] = i;
        }

        // ground reflection
        Z = (float)Math.Sqrt(RelativePermitivity - 1);

        // finding the script
        GameObject     LookUpT    = GameObject.Find("LookUpTables");
        LookUpTableGen LUT_Script = LookUpT.GetComponent <LookUpTableGen>();

        // this may not be used
        // GlobeCom2 = LUT_Script.GC2; // coordinates, normals, distances, departing and arriving angles
        // GlobeCom3 = LUT_Script.GC3; // coordinates, normals, distances, departing and arriving angles

        // reading info about MPC2
        LinearGlobeCom2          = LUT_Script.Linear_GC2;
        IndexesGlobeCom2         = LUT_Script.Indexes_GC2;
        MaxLengthOfSeenMPC2Lists = LUT_Script.MaxLengthOfSeenMPC2Lists;

        // initialize the H_parallel NativeArray
        H_LoS             = new NativeArray <System.Numerics.Complex>(H.Length, Allocator.Persistent); // Check if one array can be used by a number of jobs and correctly changed
        flag_LoS          = 0;                                                                         // flag will be needed for the edge effect
        H_MPC1            = new NativeArray <System.Numerics.Complex>(H.Length, Allocator.Persistent);
        H_MPC2            = new NativeArray <System.Numerics.Complex>(H.Length, Allocator.Persistent);
        H_MPC3            = new NativeArray <System.Numerics.Complex>(H.Length, Allocator.Persistent);
        Subcarriers       = new NativeArray <float>(H.Length, Allocator.Persistent);
        InverseWavelength = new NativeArray <float>(H.Length, Allocator.Persistent);
        for (int i = 0; i < H.Length; i++)
        {
            H[i]                 = new System.Numerics.Complex(0, 0);
            H_pure[i]            = new System.Numerics.Complex(0, 0);
            H_noise[i]           = new System.Numerics.Complex(0, 0);
            H_LoS[i]             = new System.Numerics.Complex(0, 0);
            H_MPC1[i]            = new System.Numerics.Complex(0, 0);
            H_MPC2[i]            = new System.Numerics.Complex(0, 0);
            H_MPC3[i]            = new System.Numerics.Complex(0, 0);
            Subcarriers[i]       = CarrierFrequency + fsubcarriers * (i + 1);
            InverseWavelength[i] = Subcarriers[i] / SpeedofLight;
        }

        // test allocation nativearrays
        LookUpTable2   = new NativeArray <GeoComp>(LinearGlobeCom2.Count, Allocator.Persistent);
        LookUpTable2ID = new NativeArray <Vector2Int>(IndexesGlobeCom2.Count, Allocator.Persistent);

        for (int i = 0; i < LinearGlobeCom2.Count; i++)
        {
            LookUpTable2[i] = LinearGlobeCom2[i];
        }
        for (int i = 0; i < IndexesGlobeCom2.Count; i++)
        {
            LookUpTable2ID[i] = IndexesGlobeCom2[i];
        }

        // reading info about MPC3
        LinearGlobeCom3          = LUT_Script.Linear_GC3;
        IndexesGlobeCom3         = LUT_Script.Indexes_GC3;
        MaxLengthOfSeenMPC3Lists = LUT_Script.MaxLengthOfSeenMPC3Lists;

        LookUpTable3   = new NativeArray <GeoComp>(LinearGlobeCom3.Count, Allocator.Persistent);
        LookUpTable3ID = new NativeArray <Vector2Int>(IndexesGlobeCom3.Count, Allocator.Persistent);

        for (int i = 0; i < LinearGlobeCom3.Count; i++)
        {
            LookUpTable3[i] = LinearGlobeCom3[i];
        }
        for (int i = 0; i < IndexesGlobeCom3.Count; i++)
        {
            LookUpTable3ID[i] = IndexesGlobeCom3[i];
        }
        // test allocation nativearrays



        GameObject          MPC_Spawner = GameObject.Find("Direct_Solution");
        Correcting_polygons MPC_Script  = MPC_Spawner.GetComponent <Correcting_polygons>();

        MPC1 = MPC_Script.SeenV6_MPC1;
        MPC2 = MPC_Script.SeenV6_MPC2;
        MPC3 = MPC_Script.SeenV6_MPC3;

        SeenMPC1Table = new NativeArray <V6>(MPC1.Count, Allocator.Persistent);
        for (int i = 0; i < MPC1.Count; i++)
        {
            SeenMPC1Table[i] = MPC1[i];
        }

        SeenMPC2Table = new NativeArray <V6>(MPC2.Count, Allocator.Persistent);
        for (int i = 0; i < MPC2.Count; i++)
        {
            SeenMPC2Table[i] = MPC2[i];
        }

        SeenMPC3Table = new NativeArray <V6>(MPC3.Count, Allocator.Persistent);
        for (int i = 0; i < MPC3.Count; i++)
        {
            SeenMPC3Table[i] = MPC3[i];
        }

        // assigning sripts names to the Tx and Rx
        Tx_Seen_MPC_Script = Tx.GetComponent <Transceiver_Channel>();
        Tx_Antenna_pattern = Tx_Seen_MPC_Script.Antenna_pattern;
        Rx_Seen_MPC_Script = Rx.GetComponent <Transceiver_Channel>();
        Rx_Antenna_pattern = Rx_Seen_MPC_Script.Antenna_pattern;
    }