Exemple #1
0
        protected virtual void OnButton1Clicked(object sender, System.EventArgs e)
        {
            if (isStarted)
            {
                try
                {
                    lock (mutex)
                    {
                        Monitor.PulseAll(mutex);
                    }
                }
                catch { }
            }
            else
            {
                isStarted = true;
                button1.Label = "Dalej";

                var tigr = new Tigr
                    (
                     (int)merSpin.Value,
                     (int)overhangSpin.Value,
                     (int)overlapSpin.Value,
                     (float)similaritySpin.Value,
                     sequences
                    );
                profilecontrol1.Profile = tigr.Profile;

                tigr.AssemblyCandidate += tigr_AssemblyCandidate;
                tigr.AssemblyCandidateScore += tigr_AssemblyCandidateScore;
                tigr.AssemblyGoodAlignment += tigr_AssemblyGoodAlignment;
                tigr.AssemblyEnd += tigr_AssemblyEnd;

                tigrThread = new Thread(new ThreadStart(tigr.Calculate));
                tigrThread.Start();
            }
        }
Exemple #2
0
        public static void Go()
        {
            var sequence = Utils.RandomSequence(80);
            Console.WriteLine(sequence);

            var shots = Utils.Shotgun(sequence, 160, 10, 2);
            Console.WriteLine(string.Format("Shots ({0}):", shots.Length));

            var tigr = new Tigr(4, 1, 3, 0.9f, shots);
            tigr.AssemblyInit += AssemblyInit;
            tigr.AssemblyCandidate += AssemblyCandidate;
            tigr.AssemblyGoodAlignment += AssemblyGoodAlignment;
            tigr.Calculate();
        }