Esempio n. 1
0
        public UpdateIsingDualTempVm(SimGrid <int> data)
        {
            UpdateVm = new UpdateVm(proc: Proc, containingVm: this, update_params: Update)
            {
                StepsPerUpdate = 1
            };

            Rects  = new List <RV <float, Color> >();
            Points = new List <P2V <float, Color> >();

            GraphVm = new GraphVm(new R <float>(0, 3, 0, 4))
            {
                Title  = "Energy vs Temp",
                TitleX = "Temp",
                TitleY = "Energy"
            };

            GraphLatticeVm = new GraphLatticeVm(
                new R <uint>(0, data.Width, 0, data.Height),
                "", "", "");

            GraphLatticeVm.SetUpdater(DrawGridCell, data);

            BetaLow  = 1.08f;
            BetaHigh = 2.08f;

            BetaDelta = 0.00001f;

            UpdateVm.OnUpdateUI.Subscribe(p => KeepUpdating(p));
            IsingIntBits.Init(data.Data, data.Width);
        }
Esempio n. 2
0
        public static UpdateGRVm Annealer()
        {
            var initData = SimGridIntSamples.SquareRandBits(GridSpan, 5213);
            var ggRet    = new UpdateGRVm(
                GridSpan,
                GridSpan,
                BetaBoundsW,
                EnergyBoundsW,
                BetaDelta,
                ProcIsingIntBitsEnergy,
                update_params: UpdateParams);

            ggRet.GraphLatticeVm.SetUpdater(GraphLatticeVmEx.DrawGridCell_BWR, initData);
            ggRet.UpdateVm.OnUpdateUI.Subscribe(p => UpdateGGView(p, ggRet));

            IsingIntBits.Init(initData.Data, initData.Width);

            return(ggRet);
        }