Exemple #1
0
        public static void UpdateGGView(ProcResult result, UpdateGGRVm ugvm)
        {
            ugvm.GraphLatticeTempVm.Update(result.Data["ThermGrid"]);
            ugvm.GraphLatticeFlipVm.Update(result.Data["FlipGrid"]);
            var th = (float)result.Data["TotalHeat"];

            ugvm.TotalHeat = th;
        }
Exemple #2
0
        public static UpdateGGRVm Thermo()
        {
            //var initTemps = SimGridFloatSamples.HiLow(GridSpan, 0.99f, 0.01f);
            var initTemps = SimGridFloatSamples.LeftRightGradient(GridSpan);


            var initFlips = SimGridIntSamples.SquareRandBits(GridSpan, 5213);
            var ggRet     = new UpdateGGRVm(
                width: GridSpan,
                height: GridSpan,
                beta: Beta,
                flipEnergy: FlipEnergy,
                qRate: qRate,
                proc: ProcH,
                update_params: UpdateParams);

            ggRet.GraphLatticeFlipVm.SetUpdater(GraphLatticeVmEx.DrawGridCell_int_BW_mod256, initFlips);
            ggRet.GraphLatticeTempVm.SetUpdater(GraphLatticeVmEx.DrawGridCell_float_BW_mod256, initTemps);

            ggRet.UpdateVm.OnUpdateUI.Subscribe(p => UpdateGGView(p, ggRet));

            ThermalIsing_bp.Init(initTemps.Data, initFlips.Data, initTemps.Width, BlockSize, 5566);
            return(ggRet);
        }