コード例 #1
0
ファイル: UpdateIsingBpVm.cs プロジェクト: tp-nscan/CudaClr
        public UpdateIsingBpVm(SimGrid <int> data)
        {
            UpdateVm = new UpdateVm(proc: Proc, containingVm: this, update_params: UpdateParams)
            {
                StepsPerUpdate = 1
            };

            Rects = new List <RV <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, 512, 0, 512),
                "", "", "");

            GraphLatticeVm.SetUpdater(DrawGridCell, data);

            Beta = 1.08f;

            UpdateVm.OnUpdateUI.Subscribe(p => KeepUpdating(p));

            BlockPick.Init(data.Data, data.Width, 4);
            Beta = _betaMin;
        }
コード例 #2
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);
        }
コード例 #3
0
ファイル: UpdateGridVm.cs プロジェクト: tp-nscan/CudaClr
        public UpdateGridVm(SimGrid <int> data, Func <object, ProcResult> proc, Action <object> update_params)
        {
            UpdateVm = new UpdateVm(proc: proc, containingVm: this, update_params: update_params)
            {
                StepsPerUpdate = 1
            };

            GraphLatticeVm = new GraphLatticeVm(
                new R <uint>(0, data.Height, 0, data.Width),
                "", "", "");
        }
コード例 #4
0
ファイル: UpdateGaVm.cs プロジェクト: tp-nscan/CudaClr
        public UpdateGaVm(GaData gaSortingData,
                          uint width, uint height, uint order,
                          double sorterWinRate, double sortableWinRate,
                          uint sorterCount, uint stageCount, uint sortableCount,
                          Func <object, ProcResult> proc,
                          Action <object> update_params)
        {
            UpdateVm = new UpdateVm(proc: proc, containingVm: this, update_params: update_params)
            {
                StepsPerUpdate = 10
            };
            UpdateVm.OnUpdateUI.Subscribe(p => KeepUpdating(p));

            GaSortingData   = gaSortingData;
            Order           = order;
            SorterWinRate   = sorterWinRate;
            SortableWinRate = sortableWinRate;
            SorterCount     = sorterCount;
            SortableCount   = sortableCount;
            StageCount      = stageCount;
        }
コード例 #5
0
ファイル: UpdateGGRVm.cs プロジェクト: tp-nscan/CudaClr
        public UpdateGGRVm(uint width, uint height, float beta, float flipEnergy, float qRate,
                           Func <object, ProcResult> proc, Action <object> update_params)
        {
            LatticeDisplayBounds = new R <uint>(
                minX: 0,
                maxX: (width > 1000) ? 1000 : width,
                minY: 0,
                maxY: (height > 1000) ? 1000 : height
                );

            UpdateVm = new UpdateVm(proc: proc, containingVm: this, update_params: update_params)
            {
                StepsPerUpdate = 100
            };

            GraphLatticeTempVm = new GraphLatticeVm(LatticeDisplayBounds, "Temps", "", "");

            GraphLatticeFlipVm = new GraphLatticeVm(LatticeDisplayBounds, "Flips", "", "");

            Beta       = beta;
            FlipEnergy = flipEnergy;
            Qrate      = qRate;
        }
コード例 #6
0
        public UpdateGRVm(uint width, uint height, I <float> betaBounds, I <float> energyBounds,
                          float betaDelta, Func <object, ProcResult> proc, Action <object> update_params)
        {
            BetaBounds   = betaBounds;
            EnergyBounds = energyBounds;

            LatticeDisplayBounds = new R <uint>(
                minX: 0,
                maxX: (width > 1000) ? 1000 : width,
                minY: 0,
                maxY: (height > 1000) ? 1000 : height
                );

            GraphDisplayBounds = new R <float>(
                minX: BetaBounds.Min,
                maxX: BetaBounds.Max,
                minY: EnergyBounds.Min,
                maxY: EnergyBounds.Max
                );

            UpdateVm = new UpdateVm(proc: proc, containingVm: this, update_params: update_params)
            {
                StepsPerUpdate = 100
            };

            GraphVm = new GraphVm(GraphDisplayBounds)
            {
                Title  = "Energy vs Temp",
                TitleX = "Temp",
                TitleY = "Energy"
            };

            GraphLatticeVm = new GraphLatticeVm(LatticeDisplayBounds, "", "", "");

            BetaDelta = betaDelta;
            Beta      = BetaBounds.Min;
        }
コード例 #7
0
        public JsonResult Update([FromBody] UpdateVm entity)
        {
            var result = _mongodbHelper.UpdateOne(entity.guid, entity.status);

            return(Json(result ? "成功" : "失败"));
        }