private ParticlesViewModel SetupParticlesPlot(PSOSolverData data) { var result = new ParticlesViewModel(); Show3d.AddContent(result.SetupParticles(data)); return(result); }
private void SetupFunctionPlot(PSOSolverData data) { var surface = new Surface3dViewModel() { Function = Function2d, MinX = -3, MinY = -3, MaxX = 3, MaxY = 3 }; Show3d.AddSurface(surface); }
public Model3DGroup SetupParticles(PSOSolverData data) { mParticleModels.Clear(); var result = new Model3DGroup(); foreach (var p in data.Particles) { var cube = Models.GetCube(new SolidColorBrush(Colors.Orange)); UpdateParticlePosition(cube, 0, 0, mDefaultParticleZ); mParticleModels.Add(cube); result.Children.Add(cube); } mBestSolution = Models.GetCube(new SolidColorBrush(Colors.Red)); UpdateParticlePosition(mBestSolution, 0, 0, mDefaultParticleZ); result.Children.Add(mBestSolution); return(result); }
private void UpdateStatusLabels(PSOSolverData data) { CycleInfoLabel.Content = $"Cycle no. {data.Epoch}"; BestStateLabel.Content = $"Solution at ({GetPositionString(data.BestGlobalPosition)})\nFunction value at position {Function2d(data.BestGlobalPosition)}"; // "\nError {data.BestGlobalError.ToString("F16")}"; }