Exemple #1
0
 /// <summary>
 /// Point-to-point mode functionality, with variability specified with confidence/reliability (CR)
 /// </summary>
 /// <param name="h_tx__meter">Structural height of the TX, in meters</param>
 /// <param name="h_rx__meter">Structural height of the RX, in meters</param>
 /// <param name="pfl">Terrain data, in PFL format</param>
 /// <param name="climate">Radio climate</param>
 /// <param name="N_0">Refractivity, in N-Units</param>
 /// <param name="f__mhz">Frequency, in MHz</param>
 /// <param name="pol">Polarization</param>
 /// <param name="epsilon">Relative permittivity</param>
 /// <param name="sigma">Conductivity</param>
 /// <param name="mdvar">Mode of variability</param>
 /// <param name="confidence">Confidence percentage</param>
 /// <param name="reliability">Reliability percentage</param>
 /// <param name="A__db">Basic transmission loss, in dB</param>
 /// <param name="warnings">Warning flags</param>
 /// <param name="interValues">Struct of intermediate values</param>
 /// <returns>Error code</returns>
 public static int ITM_P2P_CR_Ex(double h_tx__meter, double h_rx__meter, double[] pfl, int climate, double N_0, double f__mhz,
                                 int pol, double epsilon, double sigma, int mdvar, double confidence, double reliability, out double A__db, out long warnings,
                                 out IntermediateValues interValues)
 {
     return(ITM_CR_Ex_Invoke(h_tx__meter, h_rx__meter, pfl, climate, N_0, f__mhz, pol, epsilon, sigma, mdvar,
                             confidence, reliability, out A__db, out warnings, out interValues));
 }
Exemple #2
0
 /// <summary>
 /// Point-to-point mode functionality, with variability specified with time/location/situation (TLS)
 /// </summary>
 /// <param name="h_tx__meter">Structural height of the TX, in meters</param>
 /// <param name="h_rx__meter">Structural height of the RX, in meters</param>
 /// <param name="pfl">Terrain data, in PFL format</param>
 /// <param name="climate">Radio climate</param>
 /// <param name="N_0">Refractivity, in N-Units</param>
 /// <param name="f__mhz">Frequency, in MHz</param>
 /// <param name="pol">Polarization</param>
 /// <param name="epsilon">Relative permittivity</param>
 /// <param name="sigma">Conductivity</param>
 /// <param name="mdvar">Mode of variability</param>
 /// <param name="time">Time percentage</param>
 /// <param name="location">Location percentage</param>
 /// <param name="situation">Situation percentage</param>
 /// <param name="A__db">Basic transmission loss, in dB</param>
 /// <param name="warnings">Warning flags</param>
 /// <param name="interValues">Struct of intermediate values</param>
 /// <returns>Error code</returns>
 public static int ITM_P2P_TLS_Ex(double h_tx__meter, double h_rx__meter, double[] pfl, int climate, double N_0, double f__mhz,
                                  int pol, double epsilon, double sigma, int mdvar, double time, double location, double situation,
                                  out double A__db, out long warnings, out IntermediateValues interValues)
 {
     return(ITM_TLS_Ex_Invoke(h_tx__meter, h_rx__meter, pfl, climate, N_0, f__mhz, pol, epsilon, sigma, mdvar, time,
                              location, situation, out A__db, out warnings, out interValues));
 }
Exemple #3
0
 /// <summary>
 /// Area mode functionality
 /// </summary>
 /// <param name="h_tx__meter">Structural height of the TX, in meters</param>
 /// <param name="h_rx__meter">Structural height of the RX, in meters</param>
 /// <param name="tx_site_criteria">Siting criteria of the TX</param>
 /// <param name="rx_site_criteria">Siting criteria of the RX</param>
 /// <param name="d__km">Path distance, in km</param>
 /// <param name="delta_h__meter">Terrain irregularity parameter</param>
 /// <param name="climate">Radio climate</param>
 /// <param name="N_0">Refractivity, in N-Units</param>
 /// <param name="f__mhz">Frequency, in MHz</param>
 /// <param name="pol">Polarization</param>
 /// <param name="epsilon">Relative permittivity</param>
 /// <param name="sigma">Conductivity</param>
 /// <param name="mdvar">Mode of variability</param>
 /// <param name="confidence">Confidence percentage</param>
 /// <param name="reliability">Reliability percentage</param>
 /// <param name="A__db">Basic transmission loss, in dB</param>
 /// <param name="warnings">Warning flags</param>
 /// <param name="interValues">Struct of intermediate values</param>
 /// <returns>Error code</returns>
 public static int ITM_AREA_CR_Ex(double h_tx__meter, double h_rx__meter, int tx_site_criteria, int rx_site_criteria,
                                  double d__km, double delta_h__meter, int climate, double N_0, double f__mhz, int pol, double epsilon, double sigma,
                                  int mdvar, double confidence, double reliability, out double A__db, out long warnings,
                                  out IntermediateValues interValues)
 {
     return(ITM_AREA_CR_Ex_Invoke(h_tx__meter, h_rx__meter, tx_site_criteria, rx_site_criteria, d__km, delta_h__meter,
                                  climate, N_0, f__mhz, pol, epsilon, sigma, mdvar, confidence, reliability, out A__db, out warnings,
                                  out interValues));
 }
Exemple #4
0
        /// <summary>
        /// Point-to-point mode functionality, with variability specified with confidence/reliability (CR)
        /// </summary>
        /// <param name="h_tx__meter">Structural height of the TX, in meters</param>
        /// <param name="h_rx__meter">Structural height of the RX, in meters</param>
        /// <param name="pfl">Terrain data, in PFL format</param>
        /// <param name="climate">Radio climate</param>
        /// <param name="N_0">Refractivity, in N-Units</param>
        /// <param name="f__mhz">Frequency, in MHz</param>
        /// <param name="pol">Polarization</param>
        /// <param name="epsilon">Relative permittivity</param>
        /// <param name="sigma">Conductivity</param>
        /// <param name="mdvar">Mode of variability</param>
        /// <param name="confidence">Confidence percentage</param>
        /// <param name="reliability">Reliability percentage</param>
        /// <param name="A__db">Basic transmission loss, in dB</param>
        /// <param name="warnings">Warning flags</param>
        /// <param name="interValues">Struct of intermediate values</param>
        /// <returns>Error code</returns>
        public static int ITM_P2P_CR_Ex(double h_tx__meter, double h_rx__meter, double[] pfl, Climate climate, double N_0,
                                        double f__mhz, Polarization pol, double epsilon, double sigma, int mdvar, double confidence, double reliability,
                                        out double A__db, out Warnings warnings, out IntermediateValues interValues)
        {
            int rtn = ITM_P2P_CR_Ex(h_tx__meter, h_rx__meter, pfl, (int)climate, N_0, f__mhz, (int)pol, epsilon, sigma, mdvar,
                                    confidence, reliability, out A__db, out long warns, out interValues);

            warnings = (Warnings)warns;
            return(rtn);
        }
Exemple #5
0
        /// <summary>
        /// Area mode functionality
        /// </summary>
        /// <param name="h_tx__meter">Structural height of the TX, in meters</param>
        /// <param name="h_rx__meter">Structural height of the RX, in meters</param>
        /// <param name="tx_site_criteria">Siting criteria of the TX</param>
        /// <param name="rx_site_criteria">Siting criteria of the RX</param>
        /// <param name="d__km">Path distance, in km</param>
        /// <param name="delta_h__meter">Terrain irregularity parameter</param>
        /// <param name="climate">Radio climate</param>
        /// <param name="N_0">Refractivity, in N-Units</param>
        /// <param name="f__mhz">Frequency, in MHz</param>
        /// <param name="pol">Polarization</param>
        /// <param name="epsilon">Relative permittivity</param>
        /// <param name="sigma">Conductivity</param>
        /// <param name="mdvar">Mode of variability</param>
        /// <param name="confidence">Confidence percentage</param>
        /// <param name="reliability">Reliability percentage</param>
        /// <param name="A__db">Basic transmission loss, in dB</param>
        /// <param name="warnings">Warning flags</param>
        /// <param name="interValues">Struct of intermediate values</param>
        /// <returns>Error code</returns>
        public static int ITM_AREA_CR_Ex(double h_tx__meter, double h_rx__meter, SitingCriteria tx_site_criteria,
                                         SitingCriteria rx_site_criteria, double d__km, double delta_h__meter, Climate climate, double N_0,
                                         double f__mhz, Polarization pol, double epsilon, double sigma, int mdvar, double confidence, double reliability,
                                         out double A__db, out Warnings warnings, out IntermediateValues interValues)
        {
            int rtn = ITM_AREA_CR_Ex(h_tx__meter, h_rx__meter, (int)tx_site_criteria, (int)rx_site_criteria, d__km,
                                     delta_h__meter, (int)climate, N_0, f__mhz, (int)pol, epsilon, sigma, mdvar, confidence, reliability,
                                     out A__db, out long warns, out interValues);

            warnings = (Warnings)warns;
            return(rtn);
        }
Exemple #6
0
 private static extern int ITM_AREA_TLS_Ex_x64(double h_tx__meter, double h_rx__meter, int tx_site_criteria, int rx_site_criteria,
                                               double d__km, double delta_h__meter, int climate, double N_0, double f__mhz, int pol, double epsilon, double sigma,
                                               int mdvar, double time, double location, double situation, out double A__db, out long warnings,
                                               out IntermediateValues interValues);
Exemple #7
0
 private static extern int ITM_CR_Ex_x64(double h_tx__meter, double h_rx__meter, [MarshalAs(UnmanagedType.LPArray)] double[] pfl,
                                         int climate, double N_0, double f__mhz, int pol, double epsilon, double sigma, int mdvar, double confidence,
                                         double reliability, out double A__db, out long warnings, out IntermediateValues interValues);
Exemple #8
0
 private static extern int ITM_TLS_Ex_x64(double h_tx__meter, double h_rx__meter, [MarshalAs(UnmanagedType.LPArray)] double[] pfl,
                                          int climate, double N_0, double f__mhz, int pol, double epsilon, double sigma, int mdvar, double time, double location,
                                          double situation, out double A__db, out long warnings, out IntermediateValues interValues);
Exemple #9
0
 private static extern int ITM_AREA_CR_Ex_x86(double h_tx__meter, double h_rx__meter, int tx_site_criteria, int rx_site_criteria,
                                              double d__km, double delta_h__meter, int climate, double N_0, double f__mhz, int pol, double epsilon, double sigma,
                                              int mdvar, double confidence, double reliability, out double A__db, out long warnings, out IntermediateValues interValues);
Exemple #10
0
 private static extern void EHataEx_x64([MarshalAs(UnmanagedType.LPArray)] double[] pfl, double f__mhz, double h_b__meter,
                                        double h_m__meter, int enviro_code, double reliability, out double A__db, ref IntermediateValues intervalues);
Exemple #11
0
        /// <summary>
        /// The Extended Hata (eHata) Urban Propagation Model
        /// </summary>
        /// <param name="pfl">An ITM-formatted terrain profile, from the mobile to the base station</param>
        /// <param name="f__mhz">The frequency, in MHz</param>
        /// <param name="h_b__meter">The height of the base station, in meters</param>
        /// <param name="h_m__meter">The height of the mobile, in meters</param>
        /// <param name="environment">Clutter environment classification</param>
        /// <param name="reliability">The percent not exceeded of the signal</param>
        /// <param name="A__db">Basic transmission loss, in dB</param>
        /// <param name="interValues">A data structure containing intermediate values from the eHata calculations</param>
        public static void InvokeEx(double[] pfl, double f__mhz, double h_b__meter, double h_m__meter, ClutterEnvironment environment, double reliability, out double A__db, out IntermediateValues interValues)
        {
            interValues = new IntermediateValues();

            EHataEx_Invoke(pfl, f__mhz, h_b__meter, h_m__meter, (int)environment, reliability, out A__db, ref interValues);
        }
    public void Simulation()
    {
        var playerInput = this.playerInputCollector.GetPlayerInput();

        var innerInput = new InnerInput
        {
            userCount = new UserCount
            {
                counts = new Dictionary <UserSegment, long>
                {
                    { UserSegment.MuKakin, this.userCountProgress.MukakinUserCounts.Last() },
                    { UserSegment.BiKakin, this.userCountProgress.BikakinUserCounts.Last() },
                    { UserSegment.TyuKakin, this.userCountProgress.TyukakinUserCounts.Last() },
                    { UserSegment.JuKakin, this.userCountProgress.JukakinUserCounts.Last() },
                    { UserSegment.Sekiyuo, this.userCountProgress.SekiyuoCounts.Last() }
                }
            },
            satisfaction = new UserSatisfaction
            {
                value = this.satisfactionProgress.satisFactions.Last()
            }
        };

        var graphOutput = new GraphOutput();

        var imValues = new IntermediateValues
        {
            kindness  = 0f,
            bonusRate = 1f
        };

        var calculationHalfway = new CalculationHalfway
        {
            playerInput = playerInput,
            innerInput  = innerInput,
            graphOutput = graphOutput,
            imValues    = imValues
        };

        var result = this.calculator.Calc(calculationHalfway);

        // Update Progresses
        var profit = result.graphOutput.balance.income - result.graphOutput.balance.expenditure;

        this.moneyProgress.moneys.Add(this.moneyProgress.moneys.Last() + profit);

        var opens = result.graphOutput.opness.opens;

        if (opens != null)
        {
            this.commandOpenness.Ceiling       = opens.Contains(UpdateTarget.Ceiling);
            this.commandOpenness.CompleteGacha = opens.Contains(UpdateTarget.CompleteGacha);
        }

        this.userCountProgress.MukakinUserCounts.Add(result.innerInput.userCount.counts[UserSegment.MuKakin]);
        this.userCountProgress.BikakinUserCounts.Add(result.innerInput.userCount.counts[UserSegment.BiKakin]);
        this.userCountProgress.TyukakinUserCounts.Add(result.innerInput.userCount.counts[UserSegment.TyuKakin]);
        this.userCountProgress.JukakinUserCounts.Add(result.innerInput.userCount.counts[UserSegment.JuKakin]);
        this.userCountProgress.SekiyuoCounts.Add(result.innerInput.userCount.counts[UserSegment.Sekiyuo]);

        this.satisfactionProgress.satisFactions.Add(result.innerInput.satisfaction.value);

        this.termProgress.currentTerm++;

        if (this.termProgress.currentTerm % 4 == 0)
        {
            this.commandOpenness.ConfirmGacha = true;
        }
        else
        {
            this.commandOpenness.ConfirmGacha = false;
        }

        if (this.termProgress.currentTerm % 5 == 0)
        {
            this.commandOpenness.Update = true;
        }
        else
        {
            this.commandOpenness.Update = false;
        }

        if (this.termProgress.currentTerm == 9)
        {
            this.commandOpenness.HukubukuroGacha = true;
        }
        else
        {
            this.commandOpenness.HukubukuroGacha = false;
        }

        if (this.satisfactionProgress.satisFactions.Last() < 5f)
        {
            this.commandOpenness.StoneDistribution = true;
        }
        else
        {
            this.commandOpenness.StoneDistribution = false;
        }

        // Save Premium Gacha rates
        var premiumRates = playerInput.gachaParams[GachaCategory.Premium].rates;

        this.premiumGachaRate.nRate   = premiumRates.rates[GachaRarity.N];
        this.premiumGachaRate.rRate   = premiumRates.rates[GachaRarity.R];
        this.premiumGachaRate.srRate  = premiumRates.rates[GachaRarity.SR];
        this.premiumGachaRate.ssrRate = premiumRates.rates[GachaRarity.SSR];
        this.premiumGachaRate.urRate  = premiumRates.rates[GachaRarity.UR];
        this.premiumGachaRate.lrRate  = premiumRates.rates[GachaRarity.LR];
    }