public void UpdateP(float step, float noise) { var zippy = A2dUt.flattenRowMajor(Stars) .Zip(Noise.Take(A2dUt.Count(Stars)), (a, b) => new Tuple <Star, float>(a, b)); Parallel.ForEach(zippy, tup => tup.Item1.Update(step, tup.Item2 * noise)); Generation++; }
public void UpdateS(float step, float noise) { var zippy = A2dUt.flattenRowMajor(Stars) .Zip(Noise.Take(A2dUt.Count(Stars)), (a, b) => new Tuple <Star, float>(a, b)); foreach (var tup in zippy) { tup.Item1.Update(step, tup.Item2 * noise); } Generation++; }
public void Update(float step, float noise, float nfDecay, float absDeltaToNoise, float nfCpl, float ffCpl) { var zippy = A2dUt.flattenRowMajor(Stars) .Zip(Noise.Take(A2dUt.Count(Stars)), (a, b) => new Tuple <Star5, float>(a, b)); zippy.ToArray().AsParallel().ForEach( tup => tup.Item1.Update( step: step, noise: tup.Item2 * noise, nfDecay: nfDecay, absDeltaToNoise: absDeltaToNoise, nfCpl: nfCpl, ffCpl: ffCpl) ); //zippy.ForEach( // tup => tup.Item1.UpdateP( // step: step, // noiseLevel: tup.Item2 * noiseLevel, // nfDecay: nfDecay, // absDeltaToNoise: absDeltaToNoise, // nfCpl: nfCpl, // ffCpl: ffCpl) // ); //Parallel.ForEach(zippy, tup => tup.Item1.UpdateP( // step: step, // noiseLevel: tup.Item2 * noiseLevel, // nfDecay: nfDecay, // absDeltaToNoise: absDeltaToNoise, // nfCpl: nfCpl, // ffCpl: ffCpl)); Generation++; }
public void Update(float step, float noise, float nfDecay, float absDeltaToNoise, float nfCpl) { var zippy = A2dUt.flattenRowMajor(Stars) .Zip(Noise.Take(A2dUt.Count(Stars)), (a, b) => new Tuple <Star2, float>(a, b)); Parallel.ForEach(zippy, tup => tup.Item1.Update( step: step, noise: tup.Item2 * noise, nfDecay: nfDecay, absDeltaToNoise: absDeltaToNoise, nfCpl: nfCpl)); Generation++; }