예제 #1
0
        public bool Load(bool FOUND, bool Quantum, FormRefrigtz Curent, ref bool LoadTree, bool MovementsAStarGreedyHuristicFound, bool IInoreSelfObjects, bool UsePenaltyRegardMechnisam, bool BestMovments, bool PredictHuristic, bool OnlySelf, bool AStarGreedyHuristic, bool ArrangmentsChanged)
        {
            DrawManagement(FOUND, UsePenaltyRegardMechnisam, AStarGreedyHuristic);

            bool DrawDrawen = false;

            //Load Middle Targets.
            try
            {
                if (File.Exists(FormRefrigtz.AllDrawKindString))
                {
                    if (FormRefrigtz.MovmentsNumber >= 0)
                    {
                        if (!Quantum)
                        {
                            GalleryStudio.RefregizMemmory tr = new GalleryStudio.RefregizMemmory(MovementsAStarGreedyHuristicFound, IInoreSelfObjects, UsePenaltyRegardMechnisam, BestMovments, PredictHuristic, OnlySelf, AStarGreedyHuristic, ArrangmentsChanged);
                            t = (RefrigtzDLL.AllDraw)tr.Load(Quantum, FormRefrigtz.OrderPlate);
                            if (t != null)
                            {
                                Curent.Draw = t;

                                LoadTree    = true;
                                Curent.Draw = Curent.RootFound();

                                t = Curent.Draw;
                                //Curent.SetDrawFounding(ref FOUND, ref THIS, false);
                                DrawDrawen = true;

                                System.Windows.Forms.MessageBox.Show("Load Completed.");
                            }
                        }
                        else
                        {
                            GalleryStudio.RefregizMemmory tr = new GalleryStudio.RefregizMemmory(MovementsAStarGreedyHuristicFound, IInoreSelfObjects, UsePenaltyRegardMechnisam, BestMovments, PredictHuristic, OnlySelf, AStarGreedyHuristic, ArrangmentsChanged);
                            tt = (QuantumRefrigiz.AllDraw)tr.LoadQ(Quantum, FormRefrigtz.OrderPlate);
                            if (t != null)
                            {
                                Curent.DrawQ = tt;

                                LoadTree = true;


                                Curent.DrawQ = Curent.RootFoundQ();

                                tt = Curent.DrawQ;

                                DrawDrawen = true;

                                System.Windows.Forms.MessageBox.Show("Load Completed.");
                            }
                        }
                    }
                    File.Delete(FormRefrigtz.AllDrawKindString);
                }
            }
            catch (Exception t) { Log(t); }
            return(DrawDrawen);
        }
예제 #2
0
        public bool Save(bool FOUND, bool Quantum, FormRefrigtz Curent, ref bool LoadTree, bool MovementsAStarGreedyHeuristicFound, bool IInoreSelfObjects, bool UsePenaltyRegardMechnisam, bool BestMovments, bool PredictHeuristic, bool OnlySelf, bool AStarGreedyHeuristic, bool ArrangmentsChanged)
        {
            Object OO = new Object();

            lock (OO)
            {
                try
                {
                    RefrigtzW.AllDraw Stote = Curent.Draw;
                    if (!File.Exists(AllDrawKindString))
                    {
                        GalleryStudio.RefregizMemmory rt = new GalleryStudio.RefregizMemmory(MovementsAStarGreedyHeuristicFound, IInoreSelfObjects, UsePenaltyRegardMechnisam, BestMovments, PredictHeuristic, OnlySelf, AStarGreedyHeuristic, ArrangmentsChanged
                                                                                             );
                        //if (!Quantum)
                        {
                            if (Curent.Draw != null)
                            {
                                Curent.Draw             = Curent.RootFound();
                                rt.AllDrawCurrentAccess = Curent.Draw;
                                rt.RewriteAllDraw(FormRefrigtz.OrderPlate);
                                RefrigtzW.AllDraw.DrawTable = false;
                            }
                        }
                    }
                    else
                    if (File.Exists(AllDrawKindString))
                    {
                        File.Delete(FormRefrigtz.AllDrawKindString);
                        GalleryStudio.RefregizMemmory rt = new GalleryStudio.RefregizMemmory(MovementsAStarGreedyHeuristicFound, IInoreSelfObjects, UsePenaltyRegardMechnisam, BestMovments, PredictHeuristic, OnlySelf, AStarGreedyHeuristic, ArrangmentsChanged
                                                                                             );

                        if (Curent.Draw != null)
                        {
                            Curent.Draw             = Curent.RootFound();
                            rt.AllDrawCurrentAccess = Curent.Draw;
                            rt.RewriteAllDraw(FormRefrigtz.OrderPlate);
                            RefrigtzW.AllDraw.DrawTable = false;
                        }
                    }
                    Curent.Draw = Stote;
                    return(true);

#pragma warning disable CS0162 // Unreachable code detected
                    return(true);

#pragma warning restore CS0162 // Unreachable code detected
                }
                catch (Exception t)
                {
                    Log(t);
                    return(false);
                }
            }
        }
예제 #3
0
        public bool Load(bool FOUND, bool Quantum, ChessForm Curent, ref bool LoadTree, bool MovementsAStarGreedyHeuristicFound, bool IInoreSelfObjects, bool UsePenaltyRegardMechnisam, bool BestMovments, bool PredictHeuristic, bool OnlySelf, bool AStarGreedyHeuristic, bool ArrangmentsChanged)
        {
            Object OO = new Object();

            lock (OO)
            {
                DrawManagement(FOUND, UsePenaltyRegardMechnisam, AStarGreedyHeuristic);
                bool DrawDrawen = false;
                //Load Middle Targets.
                try
                {
                    if (File.Exists(ChessForm.AllDrawKindString))
                    {
                        if (ChessForm.MovmentsNumber >= 0)
                        {
                            //if (!Quantum)
                            {
                                GalleryStudio.RefregizMemmory tr = new GalleryStudio.RefregizMemmory(MovementsAStarGreedyHeuristicFound, IInoreSelfObjects, UsePenaltyRegardMechnisam, BestMovments, PredictHeuristic, OnlySelf, AStarGreedyHeuristic, ArrangmentsChanged);
                                t = (RefrigtzDLL.AllDraw)tr.Load(Quantum, ChessForm.OrderPlate);
                                if (t != null)
                                {
                                    Curent.Draw = t;
                                    LoadTree    = true;
                                    Curent.Draw = Curent.RootFound();
                                    //Curent.Draw.UpdateLoseAndWinDepenOfKind(Curent.Draw.OrderP);

                                    t = Curent.Draw;

                                    DrawDrawen = true;
                                    System.Windows.Forms.MessageBox.Show("Load Completed.");
                                }
                            }
                        }
                        File.Delete(ChessForm.AllDrawKindString);
                    }
                }
                catch (Exception t) { Log(t); }



                return(DrawDrawen);
            }
        }
예제 #4
0
        public bool Save(bool FOUND, bool Quantum, ChessForm Curent, ref bool LoadTree, bool MovementsAStarGreedyHeuristicFound, bool IInoreSelfObjects, bool UsePenaltyRegardMechnisam, bool BestMovments, bool PredictHeuristic, bool OnlySelf, bool AStarGreedyHeuristic, bool ArrangmentsChanged)
        {
            Object OO = new Object();

            lock (OO)
            {
                object o = new object();
                lock (o)
                {
                    if (!Quantum)
                    {
                        if (!RefrigtzDLL.AllDraw.ChangedInTreeOccured)
                        {
                            return(true);
                        }
                    }
                    else
                    {
                        if (!QuantumRefrigiz.AllDraw.ChangedInTreeOccured)
                        {
                            return(true);
                        }
                    }
                }  //System.Threading.Thread ttt = new System.Threading.Thread(new System.Threading.ThreadStart(Wait));
                   //ttt.Start();
                   //ttt.Join();

                /*if (!Quantum)
                 * {
                 *  while (Curent.Draw.AStarGreedyString != null)
                 *      Curent.Draw = Curent.Draw.AStarGreedyString;
                 * }
                 * else
                 * {
                 *  while (Curent.DrawQ.AStarGreedyString != null)
                 *      Curent.DrawQ = Curent.DrawQ.AStarGreedyString;
                 * }
                 * if (UsePenaltyRegardMechnisam && AStarGreedyHeuristic)
                 *  AllDrawKind = 4;
                 * else
                 *                                   if ((!UsePenaltyRegardMechnisam) && AStarGreedyHeuristic)
                 *  AllDrawKind = 3;
                 * if (UsePenaltyRegardMechnisam && (!AStarGreedyHeuristic))
                 *  AllDrawKind = 2;
                 * if ((!UsePenaltyRegardMechnisam) && (!AStarGreedyHeuristic))
                 *  AllDrawKind = 1;
                 * //Set Configuration To True for some unknown reason!.
                 * //UpdateConfigurationTableVal = true;
                 * SetAllDrawKindString();
                 */
                try
                {
                    RefrigtzDLL.AllDraw Stote = Curent.Draw;
                    if (!File.Exists(AllDrawKindString))
                    {
                        GalleryStudio.RefregizMemmory rt = new GalleryStudio.RefregizMemmory(MovementsAStarGreedyHeuristicFound, IInoreSelfObjects, UsePenaltyRegardMechnisam, BestMovments, PredictHeuristic, OnlySelf, AStarGreedyHeuristic, ArrangmentsChanged
                                                                                             );
                        //if (!Quantum)
                        {
                            if (Curent.Draw != null)
                            {
                                Curent.Draw             = Curent.RootFound();
                                rt.AllDrawCurrentAccess = Curent.Draw;
                                rt.RewriteAllDraw(ChessForm.OrderPlate);
                                RefrigtzDLL.AllDraw.DrawTable = false;
                                //.SetBoxText("\r\nSaved Completed.");
                                //Curent.RefreshBoxText();
                                //PictureBoxRefrigtz.SendToBack();
                                //PictureBoxTimerGray.SendToBack();
                                //PictureBoxTimerBrown.SendToBack();
                                //MessageBox.Show("Saved Completed.");
                            }
                        }

                        /*else {
                         *  if (Curent.DrawQ != null)
                         *  {
                         *      Curent.DrawQ = Curent.RootFoundQ();
                         *      rt.AllDrawCurrentAccessQ = Curent.DrawQ;
                         *      rt.RewriteAllDrawQ(ChessForm.OrderPlate);
                         *      QuantumRefrigiz.AllDraw.DrawTable = false;
                         * //Curent.SetBoxText("\r\nSaved Completed.");
                         *  //    Curent.RefreshBoxText();
                         *      //PictureBoxRefrigtz.SendToBack();
                         *      //PictureBoxTimerGray.SendToBack();
                         *      //PictureBoxTimerBrown.SendToBack();
                         *      //MessageBox.Show("Saved Completed.");
                         *  }
                         */
                    }
                    else
                    if (File.Exists(AllDrawKindString))
                    {
                        //DrawManagement(FOUND, UsePenaltyRegardMechnisam, AStarGreedyHeuristic);

                        File.Delete(ChessForm.AllDrawKindString);
                        GalleryStudio.RefregizMemmory rt = new GalleryStudio.RefregizMemmory(MovementsAStarGreedyHeuristicFound, IInoreSelfObjects, UsePenaltyRegardMechnisam, BestMovments, PredictHeuristic, OnlySelf, AStarGreedyHeuristic, ArrangmentsChanged
                                                                                             );
                        //"Universal Root Founding";
                        if (Curent.Draw != null)
                        {
                            Curent.Draw             = Curent.RootFound();
                            rt.AllDrawCurrentAccess = Curent.Draw;
                            rt.RewriteAllDraw(ChessForm.OrderPlate);
                            RefrigtzDLL.AllDraw.DrawTable = false;
                            // Curent.SetBoxText("\r\nSaved Completed.");
                            // Curent.RefreshBoxText();
                            //PictureBoxRefrigtz.SendToBack();
                            //PictureBoxTimerGray.SendToBack();
                            //PictureBoxTimerBrown.SendToBack();
                            //MessageBox.Show("Saved Completed.");
                        }
                        //DrawManagement(FOUND, UsePenaltyRegardMechnisam, AStarGreedyHeuristic);
                    }
                    Curent.Draw = Stote;
                    return(true);

                    return(true);
                }
                catch (Exception t)
                {
                    Log(t);
                    return(false);
                }
            }
        }
예제 #5
0
        public bool Save(bool FOUND, bool Quantum, HybridizerRefrigitzForm Curent, ref bool LoadTree, bool MovementsAStarGreedyHeuristicFound, bool IInoreSelfObjects, bool UsePenaltyRegardMechnisam, bool BestMovments, bool PredictHeuristic, bool OnlySelf, bool AStarGreedyHeuristic, bool ArrangmentsChanged)
        {
            Object OO = new Object();

            lock (OO)
            {
                //System.Threading.Thread ttt = new System.Threading.Thread(new System.Threading.ThreadStart(Wait));
                //ttt.Start();
                //ttt.Join();

                /*if (!Quantum)
                 * {
                 *  while (Curent.Draw.AStarGreedyString != null)
                 *      Curent.Draw = Curent.Draw.AStarGreedyString;
                 * }
                 * else
                 * {
                 *  while (Curent.DrawQ.AStarGreedyString != null)
                 *      Curent.DrawQ = Curent.DrawQ.AStarGreedyString;
                 * }
                 * if (UsePenaltyRegardMechnisam && AStarGreedyHeuristic)
                 *  AllDrawKind = 4;
                 * else
                 *                                   if ((!UsePenaltyRegardMechnisam) && AStarGreedyHeuristic)
                 *  AllDrawKind = 3;
                 * if (UsePenaltyRegardMechnisam && (!AStarGreedyHeuristic))
                 *  AllDrawKind = 2;
                 * if ((!UsePenaltyRegardMechnisam) && (!AStarGreedyHeuristic))
                 *  AllDrawKind = 1;
                 * //Set Configuration To True for some unknown reason!.
                 * //UpdateConfigurationTableVal = true;
                 * SetAllDrawKindString();
                 */
                try
                {
                    HybridizerRefrigitz.AllDraw Stote = Curent.Draw;
                    if (!File.Exists(AllDrawKindString))
                    {
#pragma warning disable CS0436 // The type 'RefregizMemmory' in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs' conflicts with the imported type 'RefregizMemmory' in 'GalleryStudio, Version=6.0.0.14, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs'.
#pragma warning disable CS0436 // The type 'RefregizMemmory' in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs' conflicts with the imported type 'RefregizMemmory' in 'GalleryStudio, Version=6.0.0.14, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs'.
                        GalleryStudio.RefregizMemmory rt = new GalleryStudio.RefregizMemmory(MovementsAStarGreedyHeuristicFound, IInoreSelfObjects, UsePenaltyRegardMechnisam, BestMovments, PredictHeuristic, OnlySelf, AStarGreedyHeuristic, ArrangmentsChanged
#pragma warning restore CS0436 // The type 'RefregizMemmory' in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs' conflicts with the imported type 'RefregizMemmory' in 'GalleryStudio, Version=6.0.0.14, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs'.
#pragma warning restore CS0436 // The type 'RefregizMemmory' in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs' conflicts with the imported type 'RefregizMemmory' in 'GalleryStudio, Version=6.0.0.14, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs'.
                                                                                             );
                        //if (!Quantum)
                        {
                            if (Curent.Draw != null)
                            {
                                Curent.Draw             = Curent.RootFound();
                                rt.AllDrawCurrentAccess = Curent.Draw;
                                rt.RewriteAllDraw(AllDraw.OrderPlate);
                                HybridizerRefrigitz.AllDraw.DrawTable = false;
                                //.SetBoxText("\r\nSaved Completed.");
                                //Curent.RefreshBoxText();
                                //PictureBoxHybridizerRefrigitz.SendToBack();
                                //PictureBoxTimerWHITE.SendToBack();
                                //PictureBoxTimerBLACK.SendToBack();
                                Console.WriteLine("Saved Completed.");
                            }
                        }

                        /*else {
                         *  if (Curent.DrawQ != null)
                         *  {
                         *      Curent.DrawQ = Curent.RootFoundQ();
                         *      rt.AllDrawCurrentAccessQ = Curent.DrawQ;
                         *      rt.RewriteAllDrawQ(HybridizerRefrigitzForm.OrderPlate);
                         *      QuantumRefrigiz.AllDraw.DrawTable = false;
                         * //Curent.SetBoxText("\r\nSaved Completed.");
                         *  //    Curent.RefreshBoxText();
                         *      //PictureBoxHybridizerRefrigitz.SendToBack();
                         *      //PictureBoxTimerWHITE.SendToBack();
                         *      //PictureBoxTimerBLACK.SendToBack();
                         *      Console.WriteLine("Saved Completed.");
                         *  }
                         */
                    }
                    else
                    if (File.Exists(AllDrawKindString))
                    {
                        //DrawManagement(FOUND, UsePenaltyRegardMechnisam, AStarGreedyHeuristic);

                        File.Delete(HybridizerRefrigitzForm.AllDrawKindString);
#pragma warning disable CS0436 // The type 'RefregizMemmory' in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs' conflicts with the imported type 'RefregizMemmory' in 'GalleryStudio, Version=6.0.0.14, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs'.
#pragma warning disable CS0436 // The type 'RefregizMemmory' in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs' conflicts with the imported type 'RefregizMemmory' in 'GalleryStudio, Version=6.0.0.14, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs'.
                        GalleryStudio.RefregizMemmory rt = new GalleryStudio.RefregizMemmory(MovementsAStarGreedyHeuristicFound, IInoreSelfObjects, UsePenaltyRegardMechnisam, BestMovments, PredictHeuristic, OnlySelf, AStarGreedyHeuristic, ArrangmentsChanged
#pragma warning restore CS0436 // The type 'RefregizMemmory' in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs' conflicts with the imported type 'RefregizMemmory' in 'GalleryStudio, Version=6.0.0.14, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs'.
#pragma warning restore CS0436 // The type 'RefregizMemmory' in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs' conflicts with the imported type 'RefregizMemmory' in 'GalleryStudio, Version=6.0.0.14, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs'.
                                                                                             );
                        //"Universal Root Founding";
                        if (Curent.Draw != null)
                        {
                            Curent.Draw             = Curent.RootFound();
                            rt.AllDrawCurrentAccess = Curent.Draw;
                            rt.RewriteAllDraw(AllDraw.OrderPlate);
                            HybridizerRefrigitz.AllDraw.DrawTable = false;
                            // Curent.SetBoxText("\r\nSaved Completed.");
                            // Curent.RefreshBoxText();
                            //PictureBoxHybridizerRefrigitz.SendToBack();
                            //PictureBoxTimerWHITE.SendToBack();
                            //PictureBoxTimerBLACK.SendToBack();
                            Console.WriteLine("Saved Completed.");
                        }
                        //DrawManagement(FOUND, UsePenaltyRegardMechnisam, AStarGreedyHeuristic);
                    }
                    Curent.Draw = Stote;
                    return(true);

#pragma warning disable CS0162 // Unreachable code detected
                    return(true);

#pragma warning restore CS0162 // Unreachable code detected
                }
                catch (Exception t)
                {
                    Log(t);
                    return(false);
                }
            }
        }
예제 #6
0
        public bool Load(bool FOUND, bool Quantum, HybridizerRefrigitzForm Curent, ref bool LoadTree, bool MovementsAStarGreedyHeuristicFound, bool IInoreSelfObjects, bool UsePenaltyRegardMechnisam, bool BestMovments, bool PredictHeuristic, bool OnlySelf, bool AStarGreedyHeuristic, bool ArrangmentsChanged)
        {
            Object OO = new Object();

            lock (OO)
            {
                DrawManagement(FOUND, UsePenaltyRegardMechnisam, AStarGreedyHeuristic);

                bool DrawDrawen = false;
                //Load Middle Targets.
                try
                {
                    if (File.Exists(HybridizerRefrigitzForm.AllDrawKindString))
                    {
                        if (HybridizerRefrigitzForm.MovmentsNumber >= 0)
                        {
                            //if (!Quantum)
                            {
#pragma warning disable CS0436 // The type 'RefregizMemmory' in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs' conflicts with the imported type 'RefregizMemmory' in 'GalleryStudio, Version=6.0.0.14, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs'.
#pragma warning disable CS0436 // The type 'RefregizMemmory' in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs' conflicts with the imported type 'RefregizMemmory' in 'GalleryStudio, Version=6.0.0.14, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs'.
                                GalleryStudio.RefregizMemmory tr = new GalleryStudio.RefregizMemmory(MovementsAStarGreedyHeuristicFound, IInoreSelfObjects, UsePenaltyRegardMechnisam, BestMovments, PredictHeuristic, OnlySelf, AStarGreedyHeuristic, ArrangmentsChanged);
#pragma warning restore CS0436 // The type 'RefregizMemmory' in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs' conflicts with the imported type 'RefregizMemmory' in 'GalleryStudio, Version=6.0.0.14, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs'.
#pragma warning restore CS0436 // The type 'RefregizMemmory' in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs' conflicts with the imported type 'RefregizMemmory' in 'GalleryStudio, Version=6.0.0.14, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs'.
                                t = (HybridizerRefrigitz.AllDraw)tr.Load(Quantum, AllDraw.OrderPlate);
                                if (t != null)
                                {
                                    Curent.Draw = t;

                                    LoadTree    = true;
                                    Curent.Draw = Curent.RootFound();

                                    //Curent.Draw.UpdateLoseAndWinDepenOfKind(Curent.Draw.OrderP);


                                    t = Curent.Draw;
                                    //Curent.SetDrawFounding(ref FOUND, ref THIS, false);
                                    DrawDrawen = true;

                                    //System.Windows.Forms.MessageBox.Show("Load Completed.");
                                }
                            }

                            /*else
                             * {
                             *  GalleryStudio.RefregizMemmory tr = new GalleryStudio.RefregizMemmory(MovementsAStarGreedyHeuristicFound, IInoreSelfObjects, UsePenaltyRegardMechnisam, BestMovments, PredictHeuristic, OnlySelf, AStarGreedyHeuristic, ArrangmentsChanged);
                             * tt =(QuantumRefrigiz.AllDraw) tr.LoadQ(Quantum, HybridizerRefrigitzForm.OrderPlate);
                             *  if (t != null)
                             *  {
                             *
                             *      Curent.DrawQ = tt;
                             *
                             *      LoadTree = true;
                             *
                             *
                             *      Curent.DrawQ = Curent.RootFoundQ();
                             *
                             *      tt = Curent.DrawQ;
                             *
                             *      DrawDrawen = true;
                             *
                             *      //System.Windows.Forms.MessageBox.Show("Load Completed.");
                             *  }
                             * }*/
                        }
                        File.Delete(HybridizerRefrigitzForm.AllDrawKindString);
                    }
                }
                catch (Exception t) { Log(t); }
                //System.Threading.Thread ttt = new System.Threading.Thread(new System.Threading.ThreadStart(Wait));
                //ttt.Start();
                //ttt.Join();

                return(DrawDrawen);
            }
        }
예제 #7
0
        public bool Load(bool FOUND, bool Quantum, RefrigtzChessPortableForm Curent, ref bool LoadTree, bool MovementsAStarGreedyHeuristicFound, bool IInoreSelfobjects, bool UsePenaltyRegardMechnisam, bool BestMovments, bool PredictHeuristic, bool OnlySelf, bool AStarGreedyHeuristic, bool ArrangmentsChanged)
        {
            object OO = new object();

            lock (OO)
            { if (!DrawManagement(FOUND, UsePenaltyRegardMechnisam, AStarGreedyHeuristic))
              {
                  return(false);
              }

              var ttt = Task.Factory.StartNew(() => Wait(AllDrawKindString));

              ttt.Wait();


              bool DrawDrawen = false;
              //Load Middle Targets.
              try
              {
                  if (File.Exists(AllDrawKindString))
                  {
                      if (RefrigtzChessPortableForm.MovmentsNumber >= 0)
                      {
                          //if (!Quantum)
                          {
                              GalleryStudio.RefregizMemmory tr = new GalleryStudio.RefregizMemmory(MovementsAStarGreedyHeuristicFound, IInoreSelfobjects, UsePenaltyRegardMechnisam, BestMovments, PredictHeuristic, OnlySelf, AStarGreedyHeuristic, ArrangmentsChanged);


                              t = (RefrigtzChessPortable.AllDraw)tr.Load(Quantum, RefrigtzChessPortableForm.OrderPlate);
                              if (t != null)
                              {
                                  Curent.Draw = t;

                                  LoadTree    = true;
                                  Curent.Draw = Curent.RootFound();

                                  //Curent.Draw.UpdateLoseAndWinDepenOfKind(Curent.Draw.OrderP);


                                  t = Curent.Draw;
                                  //Curent.SetDrawFounding(ref FOUND, ref THIS, false);
                                  DrawDrawen = true;

                                  //System.Windows.Forms.//MessageBox.Show("Load Completed.");
                              }
                          }

                          /*else
                           * {
                           *  GalleryStudio.RefregizMemmory tr = new GalleryStudio.RefregizMemmory(MovementsAStarGreedyHeuristicFound, IInoreSelfobjects, UsePenaltyRegardMechnisam, BestMovments, PredictHeuristic, OnlySelf, AStarGreedyHeuristic, ArrangmentsChanged);
                           * tt =(QuantumRefrigiz.AllDraw) tr.LoadQ(Quantum, RefrigtzChessPortableForm.OrderPlate);
                           *  if (t != null)
                           *  {
                           *
                           *      Curent.DrawQ = tt;
                           *
                           *      LoadTree = true;
                           *
                           *
                           *      Curent.DrawQ = Curent.RootFoundQ();
                           *
                           *      tt = Curent.DrawQ;
                           *
                           *      DrawDrawen = true;
                           *
                           *      //System.Windows.Forms.//MessageBox.Show("Load Completed.");
                           *  }
                           * }*/
                      }
                      File.Delete(RefrigtzChessPortableForm.AllDrawKindString);
                  }
              }
              catch (Exception t) { /*Log(t);*/ }
              //System.Threading.Thread ttt = new System.Threading.Thread(new System.Threading.ThreadStart(Wait));
              //ttt.Start();
              //ttt.Join();

              return(DrawDrawen); }
        }
예제 #8
0
        public bool Save(bool FOUND, bool Quantum, ChessForm Curent, ref bool LoadTree, bool MovementsAStarGreedyHeuristicFound, bool IInoreSelfObjects, bool UsePenaltyRegardMechnisam, bool BestMovments, bool PredictHeuristic, bool OnlySelf, bool AStarGreedyHeuristic, bool ArrangmentsChanged)
        {
            Object OO = new Object();

            lock (OO)
            {
                object o = new object();
                lock (o)
                {
                    if (!Quantum)
                    {
                        if (!RefrigtzDLL.AllDraw.ChangedInTreeOccured)
                        {
                            return(true);
                        }
                    }
                }

                try
                {
                    RefrigtzDLL.AllDraw Stote = Curent.Draw;
                    if (!File.Exists(AllDrawKindString))
                    {
                        GalleryStudio.RefregizMemmory rt = new GalleryStudio.RefregizMemmory(MovementsAStarGreedyHeuristicFound, IInoreSelfObjects, UsePenaltyRegardMechnisam, BestMovments, PredictHeuristic, OnlySelf, AStarGreedyHeuristic, ArrangmentsChanged
                                                                                             );
                        //if (!Quantum)
                        {
                            if (Curent.Draw != null)
                            {
                                Curent.Draw             = Curent.RootFound();
                                rt.AllDrawCurrentAccess = Curent.Draw;
                                rt.RewriteAllDraw(ChessForm.OrderPlate);
                                RefrigtzDLL.AllDraw.DrawTable = false;
                            }
                        }
                    }
                    else
                    if (File.Exists(AllDrawKindString))
                    {
                        File.Delete(ChessForm.AllDrawKindString);
                        GalleryStudio.RefregizMemmory rt = new GalleryStudio.RefregizMemmory(MovementsAStarGreedyHeuristicFound, IInoreSelfObjects, UsePenaltyRegardMechnisam, BestMovments, PredictHeuristic, OnlySelf, AStarGreedyHeuristic, ArrangmentsChanged
                                                                                             );

                        if (Curent.Draw != null)
                        {
                            Curent.Draw             = Curent.RootFound();
                            rt.AllDrawCurrentAccess = Curent.Draw;
                            rt.RewriteAllDraw(ChessForm.OrderPlate);
                            RefrigtzDLL.AllDraw.DrawTable = false;
                        }
                    }
                    Curent.Draw = Stote;
                    return(true);

                    return(true);
                }
                catch (Exception t)
                {
                    Log(t);
                    return(false);
                }
            }
        }