Example #1
0
        public override void OnDraw()
        {
            RendererBase <T> rendererForSurfaceThisIsOn = Parrent.GetRenderer();

            for (uint i = 0; i < num_paths(); i++)
            {
                rendererForSurfaceThisIsOn.Render(this, i, color(i).GetAsRGBA_Bytes());
            }
            base.OnDraw();
        }
Example #2
0
 protected override void OnParrentChanged(object sender, EventArgs args)
 {
     base.OnParrentChanged(sender, args);
     if (Parrent != null)
     {
         Parrent.AddControl(itemControl);
         showItems            = false;
         itemControl.Location = new Point(Location.X, Location.Y + Height);
         GenerateItemControl();
     }
 }
Example #3
0
 protected override void OnClick(object sender, MouseEventArgs args)
 {
     base.OnClick(sender, args);
     showItems = !showItems;
     if (showItems == true)
     {
         if (Parrent != null)
         {
             Parrent.BringToFront(itemControl);
         }
     }
 }
 /// <summary>
 /// Закрытие окна загрузки
 /// </summary>
 public void CloseScreen()
 {
     this.Dispatcher.Invoke(new Action(() => this.Close()));
     uiThread.IsBackground = false;
     if (Parrent != null)
     {
         Parrent.Dispatcher.Invoke(new Action(() => Parrent.Activate()));
     }
     while (progressDisptacher == null)
     {
         continue;
     }
     progressDisptacher.InvokeShutdown();
 }
Example #5
0
        public ScoutParams(KnowlegeBaseTSARules theSource, BeeParamsAlgorithm parrent, Random rand)
            : base(theSource, parrent)
        {
            for (int i = 0; i < PositionOfBee.TermsSet.Count; i++)
            {
                int    Varrible = PositionOfBee.TermsSet[i].NumVar;
                double Scatter  = Parrent.getCurrentNs().LearnSamplesSet.InputAttributes[Varrible].Scatter;

                switch (PositionOfBee.TermsSet[i].TermFuncType)
                {
                case TypeTermFuncEnum.Гауссоида: { PositionOfBee.TermsSet[i].Parametrs = optimizeGauss(Scatter, PositionOfBee.TermsSet[i].Parametrs, rand); } break;

                case TypeTermFuncEnum.Парабола: { PositionOfBee.TermsSet[i].Parametrs = optimizeParabolic(Scatter, PositionOfBee.TermsSet[i].Parametrs, rand); } break;

                case TypeTermFuncEnum.Трапеция: { PositionOfBee.TermsSet[i].Parametrs = optimizeTrapec(Scatter, PositionOfBee.TermsSet[i].Parametrs, rand); } break;

                case TypeTermFuncEnum.Треугольник: { PositionOfBee.TermsSet[i].Parametrs = optimizeTrianlge(Scatter, PositionOfBee.TermsSet[i].Parametrs, rand); } break;
                }
            }

            getGoodsImproove();

            //      SAFuzzySystem ToOpintNS = Parrent.getCurrentNs();

            /*      lock (ToOpintNS)
             *    {
             *        Adaptive_LSM tryOpt = new Adaptive_LSM();
             *
             *
             *
             *
             *        double tempgood = getGoodsImproove();
             *        KnowlegeBaseSARules tempPositionofBee = PositionOfBee;
             *        KnowlegeBaseSARules zeroSolution = ToOpintNS.RulesDatabaseSet[0];
             *        ToOpintNS.RulesDatabaseSet[0] = PositionOfBee;
             *
             *        tryOpt.TuneUpFuzzySystem(ToOpintNS, new NullConfForAll());
             *        PositionOfBee = ToOpintNS.RulesDatabaseSet[0];
             *        double newgood = getGoodsImproove();
             *
             *        if (newgood > tempgood)
             *        {
             *            PositionOfBee = tempPositionofBee;
             *            getGoodsImproove();
             *        }
             *    } */
        }
Example #6
0
        /// <summary>
        /// Retrieves a vertex by its global id.
        /// </summary>
        /// <param name="globalVertexIndex">
        /// The global id of the vertex to be retrieved.
        /// </param>
        /// <returns>
        /// The spatial coordinates of the vertex with global id
        /// <paramref name="globalVertexIndex"/>.
        /// </returns>
        public double[] GetVertex(int globalVertexIndex)
        {
            int localIndex = GetLocalFromGlobalVertexIndex(globalVertexIndex);

            if (localIndex < 0)
            {
                if (Parrent == null)
                {
                    throw new Exception("Unknown vertex index " + globalVertexIndex);
                }
                else
                {
                    return(Parrent.GetVertex(globalVertexIndex));
                }
            }
            else
            {
                return(listOfVertices[localIndex].Coordinates);
            }
        }
Example #7
0
        /// <summary>
        /// Tries to determine the global vertex index associated with the
        /// given vertex.
        /// </summary>
        /// <param name="vertex">
        /// The vertex in question.
        /// </param>
        /// <returns>
        /// The global vertex id of <paramref name="vertex"/> if it is
        /// contained in this set or one of its ancestors. Otherwise, -1 will
        /// be returned.
        /// </returns>
        private int GetGlobalVertexIndex(ref Vertex vertex)
        {
            Debug.Assert(
                vertex.Coordinates.Length == SpatialDimension,
                "Wrong spatial dimension of vertex");

            int index = GetLocalVertexIndex(ref vertex);

            if (index < 0)
            {
                if (Parrent != null)
                {
                    index = Parrent.GetGlobalVertexIndex(ref vertex);
                }
                return(index);
            }
            else
            {
                return(index + IndexOffset);
            }
        }
Example #8
0
 public virtual void Invalidate(RectDouble <T> rectToInvalidate)
 {
     Parrent.Invalidate(rectToInvalidate);
 }
Example #9
0
 public virtual void Invalidate()
 {
     Parrent.Invalidate(Bounds);
 }