Exemple #1
0
        //public void CalcDelta()
        //{
        //    DeltaL = NNfunc.ModUFDelta(CurValue, Left.CurValue);
        //    DeltaR = NNfunc.ModUFDelta(CurValue, Right.CurValue);
        //    DeltaT = NNfunc.ModUFDelta(CurValue, Top.CurValue);
        //    DeltaB = NNfunc.ModUFDelta(CurValue, Bottom.CurValue);

        //    Delta = DeltaL + DeltaR + DeltaT + DeltaB;

        //    AbsDelta = Math.Abs(DeltaL) + Math.Abs(DeltaR) +
        //               Math.Abs(DeltaT) + Math.Abs(DeltaB);

        //    NoiseFieldCpl = Left.NoiseField + Right.NoiseField +
        //                    Top.NoiseField + Bottom.NoiseField;
        //}

        //public void UpdateP(float step,
        //                   float noise,
        //                   float nfDecay,
        //                   float absDeltaToNoise,
        //                   float nfCpl,
        //                   float ffCpl)
        //{
        //    if (Math.Abs(FixedValue) > NumUt.Epsilon)
        //    {
        //        Delta += ffCpl * NNfunc.ModUFDelta(CurValue, FixedValue);
        //    }

        //    NoiseField = NoiseField * nfDecay +
        //                 AbsDelta * absDeltaToNoise +
        //                 NoiseFieldCpl * nfCpl;

        //    CurValue = NumUt.ModUF32(CurValue + Delta * step + noise * NoiseField);

        //}

        public void Update(float step,
                           float noise,
                           float nfDecay,
                           float absDeltaToNoise,
                           float nfCpl,
                           float ffCpl)
        {
            DeltaL = NNfunc.ModUFDelta(CurValue, Left.CurValue);
            DeltaR = NNfunc.ModUFDelta(CurValue, Right.CurValue);
            DeltaT = NNfunc.ModUFDelta(CurValue, Top.CurValue);
            DeltaB = NNfunc.ModUFDelta(CurValue, Bottom.CurValue);

            Delta = DeltaL + DeltaR + DeltaT + DeltaB;

            AbsDelta = Math.Abs(DeltaL) + Math.Abs(DeltaR) +
                       Math.Abs(DeltaT) + Math.Abs(DeltaB);

            NoiseFieldCpl = Left.NoiseField + Right.NoiseField +
                            Top.NoiseField + Bottom.NoiseField;


            if (Math.Abs(FixedValue) > NumUt.Epsilon)
            {
                Delta += ffCpl * NNfunc.ModUFDelta(CurValue, FixedValue);
            }

            NoiseField = NoiseField * nfDecay +
                         AbsDelta * absDeltaToNoise +
                         NoiseFieldCpl * nfCpl;

            CurValue = NumUt.ModUF32(CurValue + Delta * step + noise * NoiseField);
        }
Exemple #2
0
        public void Update(float step, float noise, float nfDecay,
                           float absDeltaToNoise, float nfCpl)
        {
            NoiseField = NoiseField * nfDecay +
                         AbsDelta * absDeltaToNoise +
                         NoiseFieldCpl * nfCpl;

            CurValue = NumUt.ModUF32(CurValue + Delta * step + noise * NoiseField);
        }
Exemple #3
0
        public void Update(float step, float noise, float ffCpl)
        {
            if (Math.Abs(FixedValue) > NumUt.Epsilon)
            {
                Delta += ffCpl * NNfunc.ModUFDelta(CurValue, FixedValue);
            }

            CurValue = NumUt.ModUF32(CurValue + Delta * step + noise);
        }
Exemple #4
0
        public void Update(float step,
                           float noise,
                           float nfDecay,
                           float absDeltaToNoise,
                           float nfCpl,
                           float ffCpl)
        {
            if (Math.Abs(FixedValue) > NumUt.Epsilon)
            {
                Delta += ffCpl * NNfunc.ModUFDelta(CurValue, FixedValue);
            }

            NoiseField = NoiseField * nfDecay +
                         AbsDelta * absDeltaToNoise +
                         NoiseFieldCpl * nfCpl;

            CurValue = NumUt.ModUF32(CurValue + Delta * step + noise * NoiseField);
        }
Exemple #5
0
        public static P1V <int, float> Update(this NodeGrid nodeGrid, int index, float step, float noiseLevel)
        {
            var curValue = nodeGrid.Values[index];
            var deltaL   = NNfunc.ModUFDelta(curValue, nodeGrid.Values[nodeGrid.Left[index]]);
            var deltaR   = NNfunc.ModUFDelta(curValue, nodeGrid.Values[nodeGrid.Right[index]]);
            var deltaT   = NNfunc.ModUFDelta(curValue, nodeGrid.Values[nodeGrid.Top[index]]);
            var deltaB   = NNfunc.ModUFDelta(curValue, nodeGrid.Values[nodeGrid.Bottom[index]]);

            var ptb = NumUt.ModUF32(
                curValue +
                noiseLevel * nodeGrid.Noise[index] +
                step * (
                    deltaL +
                    deltaR +
                    deltaT +
                    deltaB
                    )
                );

            return(new P1V <int, float>(index, ptb));
        }
Exemple #6
0
        public P1V <int, float> Update(int index, float noiseLevel, float step)
        {
            var curValue = Values[index];
            var deltaL   = NNfunc.ModUFDelta(curValue, Values[Left[index]]);
            var deltaR   = NNfunc.ModUFDelta(curValue, Values[Right[index]]);
            var deltaT   = NNfunc.ModUFDelta(curValue, Values[Top[index]]);
            var deltaB   = NNfunc.ModUFDelta(curValue, Values[Bottom[index]]);

            var ptb = NumUt.ModUF32
                      (
                curValue +
                noiseLevel * Noise[index] +
                step * (
                    deltaL +
                    deltaR +
                    deltaT +
                    deltaB
                    )
                      );

            return(new P1V <int, float>(index, ptb));
        }
Exemple #7
0
 public void Update(float step, float noise)
 {
     CurValue = NumUt.ModUF32(CurValue + Delta * step + noise);
 }