protected override void ProcessBeforeFrame(IUniverse uni)
 {
     initialMomentums = uni.BodiesWithin(Volume).ToDictionary(b => b, b => b.Dynamics.P);
 }
Exemple #2
0
 public T TakeMeasurement(IUniverse uni) => FinalizeFunc(uni.BodiesWithin(Volume).Aggregate(default(T), AccumulationFunc));
 public int TakeMeasurement(IUniverse uni) => uni.BodiesWithin(Volume).Count();
 public ContinuousDistribution TakeMeasurement(IUniverse uni) => new ContinuousDistribution(uni.BodiesWithin(Volume).Select(b => b.Dynamics.Kinematics.V.Magnitude));
        protected override double ProcessAfterFrame(IUniverse uni)
        {
            double massAfter = uni.BodiesWithin(Volume).Sum(b => b.Dynamics.Mass);

            return(massAfter - massBefore);
        }
 protected override void ProcessBeforeFrame(IUniverse uni)
 {
     massBefore = uni.BodiesWithin(Volume).Sum(b => b.Dynamics.Mass);
 }