当前位置: 首页>>代码示例>>C#>>正文


C# Stats.Append方法代码示例

本文整理汇总了C#中Stats.Append方法的典型用法代码示例。如果您正苦于以下问题:C# Stats.Append方法的具体用法?C# Stats.Append怎么用?C# Stats.Append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Stats的用法示例。


在下文中一共展示了Stats.Append方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Main

    public static void Main(string[] args)
    {
        int simCount = 5000;
        if (args.Length == 1)
            simCount = int.Parse(args[0]);

        Deck d = new Deck();
        PokerHand hand = new PokerHand(d);

        Stats stats = new Stats();
        stats.simCount = simCount;
        for (int i=0;i<simCount;i++)
        {
            // worry counter
            if ((i%1000)==0)
                Console.Write("*");
            d.shuffle();
            hand.pullCards();
            hand.Sort();
            POKERSCORE ps = PokerLogic.score(hand);
            stats.Append(ps);
        }
        Console.WriteLine();
        stats.Report();
    }
开发者ID:ramonliu,项目名称:poker-miranda,代码行数:25,代码来源:PokerLogic.cs

示例2: SimulateStage

        //Simulate (the rest of) the current stage of the simulated rocket,
        //and return stats for the stage
        public Stats SimulateStage(float throttle, float atmospheres)
        {
            Stats stats = new Stats();
            stats.startMass = VesselMass();
            stats.startThrust = VesselThrust(throttle);
            stats.endMass = stats.startMass;
            stats.maxAccel = stats.startThrust / stats.endMass;
            stats.deltaTime = 0;
            stats.deltaV = 0;

            foreach (FuelNode n in nodes) n.SetConsumptionRates(throttle, atmospheres); //need to set initial consumption rates for allowedToStage to work right

            const int maxSteps = 100;
            int step;
            for (step = 0; step < maxSteps; step++)
            {
                if (AllowedToStage()) break;
                float dt;
                stats = stats.Append(SimulateTimeStep(float.MaxValue, throttle, atmospheres, out dt));
            }

            //Debug.Log("Finished stage " + simStage + " after " + step + " steps");
            if (step == maxSteps) throw new Exception("FuelFlowSimulation.SimulateStage reached max step count of " + maxSteps);

            return stats;
        }
开发者ID:Raf04,项目名称:MechJeb2,代码行数:28,代码来源:FuelFlowSimulation.cs

示例3: SimulateStage

        //Simulate (the rest of) the current stage of the simulated rocket,
        //and return stats for the stage
        public Stats SimulateStage(float throttle, double staticPressure, double atmDensity, double machNumber)
        {
            //need to set initial consumption rates for VesselThrust and AllowedToStage to work right
            for (int i = 0; i < nodes.Count; i++)
            {
                nodes[i].SetConsumptionRates(throttle, atmDensity, machNumber);
            }

            Stats stats = new Stats();
            stats.startMass = VesselMass(simStage);
            stats.startThrust = VesselThrust(throttle, staticPressure, atmDensity, machNumber);
            stats.endMass = stats.startMass;
            stats.resourceMass = 0;
            stats.maxAccel = stats.endMass > 0 ? stats.startThrust / stats.endMass : 0;
            stats.deltaTime = 0;
            stats.deltaV = 0;

            const int maxSteps = 100;
            int step;
            for (step = 0; step < maxSteps; step++)
            {
                if (AllowedToStage()) break;
                float dt;
                stats = stats.Append(SimulateTimeStep(float.MaxValue, throttle, staticPressure, atmDensity, machNumber, out dt));
            }

            //print("Finished stage " + simStage + " after " + step + " steps");
            if (step == maxSteps) throw new Exception("FuelFlowSimulation.SimulateStage reached max step count of " + maxSteps);

            return stats;
        }
开发者ID:CliftonMarien,项目名称:MechJeb2,代码行数:33,代码来源:FuelFlowSimulation.cs


注:本文中的Stats.Append方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。