本文整理汇总了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();
}
示例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;
}
示例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;
}