public void RunTSP(TSPAlgorithm algorithm)
        {
            //LastTSPResult = null;
            LastRoute = null;
            IList <TNode> result = null;

            LastBenchmark = RunningTime.TestNow(() =>
            {
                switch (algorithm)
                {
                //case TSPAlgorithm.LKH:
                //    result = lkh.Solve(Nodes, costAnalyzer);
                //    break;
                case TSPAlgorithm.EAX:
                    var problem = new TSPProblem(0, costMatrix.Matrix);
                    LastRoute   = eax.Solve(problem);
                    break;
                    //case TSPAlgorithm.NN:
                    //    result = nearestNeighbor.Solve(Nodes, costAnalyzer);
                    //    break;
                    //case TSPAlgorithm.OLC:
                    //    result = oneLoopCheapestInsertion.Solve(Nodes, costByReference, costAnalyzer);
                    //    break;
                    //case TSPAlgorithm.RAI:
                    //    result = randomArbitraryInsertion.Solve(Nodes, costByReference, costAnalyzer);
                    //    break;
                }
            });

            //if (result != null)
            //    LastTSPResult = new TSPResult<TNode, double>(result);

            cluster_AfterIterationEvent(this, EventArgs.Empty);
        }
Exemple #2
0
        public void Always_Use_Fixed_Values()
        {
            var source    = DateTime.Now;
            var expected  = source.ToShortTimeString();
            var formatted = RunningTime.FormatToReport(source);

            Assert.That(formatted, Is.EqualTo(expected));
        }
        public void Always_Use_Fixed_Values()
        {
            var source    = new DateTime(2000, 9, 12, 14, 36, 41, DateTimeKind.Utc);
            var expected  = "2:36:41 PM";
            var formatted = RunningTime.FormatToReport(source);

            Assert.That(formatted, Is.EqualTo(expected));
        }
Exemple #4
0
        public bool Find(string find, int findType)
        {
            if (find == "" || find == String.Empty || find == null)
            {
                return(true);
            }
            switch (findType)
            {
            case 0:
                if (Subject.IndexOf(find) > -1)
                {
                    return(true);
                }
                break;

            case 1:
                if (BodyText.IndexOf(find) > -1)
                {
                    return(true);
                }
                break;

            case 2:
                if (CreateTime.ToString().IndexOf(find) > -1)
                {
                    return(true);
                }
                break;

            case 3:
                if (RunningTime.ToString().IndexOf(find) > -1)
                {
                    return(true);
                }
                break;

            case 4:
                if (Subject.IndexOf(find) > -1)
                {
                    return(true);
                }
                if (BodyText.IndexOf(find) > -1)
                {
                    return(true);
                }
                if (CreateTime.ToString().IndexOf(find) > -1)
                {
                    return(true);
                }
                if (RunningTime.ToString().IndexOf(find) > -1)
                {
                    return(true);
                }
                break;
            }
            return(false);
        }
Exemple #5
0
 //----------------------------------------------------------------------------------------------
 /// <summary>このオブジェクトのデータを文字列配列に格納して返す</summary>
 /// <return>文字列配列に格納したデータ</return>
 public string[] ToArray()
 {
     string[] array = new string[4];
     array[0] = UserId;
     array[1] = StartDatetime.ToString(Constants.DATETIME_FORMAT);
     array[2] = EndDatetime.ToString(Constants.DATETIME_FORMAT);
     array[3] = RunningTime.ToString();
     return(array);
 }
Exemple #6
0
        public void TestRunningTimeIsNotNull()
        {
            //arreng

            //act
            RunningTime c = new RunningTime();

            //assert
            Assert.IsNotNull(c);
        }
Exemple #7
0
        public void runningTime_Test()
        {
            var arr = new List <int> {
                2, 1, 3, 1, 2,
            };

            var actual = RunningTime.Calculate(arr.ToArray());

            Assert.Equal(4, actual);
        }
Exemple #8
0
 public void FillAddNewMovieForm(AddMovie movie)
 {
     NameField.SendKeys(movie.Name);
     DescriptionField.SendKeys(movie.Description);
     ReleaseDate.SendKeys(movie.ReleaseDate);
     RunningTime.SendKeys(movie.RunningTime);
     Genre.SendKeys(movie.Genre);
     Position.SendKeys(movie.Position);
     AddButton.Click();
 }
Exemple #9
0
        public void TestPaceKMH()
        {
            RunningTime runningTime = new RunningTime();

            runningTime.Hours   = 1;
            runningTime.Minutes = 21;
            runningTime.Seconds = 50;

            Pace pace = Calculation.CalculateAveragePace(21.097, runningTime);

            Assert.AreEqual(pace.Minutes, 3);
            Assert.AreEqual(pace.Seconds, 52);
        }
        void ReleaseDesignerOutlets()
        {
            if (Cast != null)
            {
                Cast.Dispose();
                Cast = null;
            }

            if (Mpaa != null)
            {
                Mpaa.Dispose();
                Mpaa = null;
            }

            if (RunningTime != null)
            {
                RunningTime.Dispose();
                RunningTime = null;
            }

            if (ReleaseDate != null)
            {
                ReleaseDate.Dispose();
                ReleaseDate = null;
            }

            if (Synopsis != null)
            {
                Synopsis.Dispose();
                Synopsis = null;
            }

            if (RottenIndicator != null)
            {
                RottenIndicator.Dispose();
                RottenIndicator = null;
            }

            if (CriticReview != null)
            {
                CriticReview.Dispose();
                CriticReview = null;
            }

            if (Director != null)
            {
                Director.Dispose();
                Director = null;
            }
        }
Exemple #11
0
        public void TestRunningTimeNum_return3()
        {
            //arreng
            int a = 3;

            //act
            RunningTime c = new RunningTime()
            {
                Num = a
            };


            //assert
            Assert.AreEqual(c.Num, a);
        }
Exemple #12
0
        public void Prepare()
        {
            _streamSyncBarrier.Reset();
            _syncClock = null;

            foreach (var state in _streamSyncData)
            {
                if (state == null)
                {
                    continue;
                }

                state.SyncState = SynchronizationState.ClockStart;
                state.Pts       = TimeSpan.Zero;
                state.LastSync  = TimeSpan.Zero;
                _streamSyncBarrier.AddParticipant();
            }

            Logger.Info("");
        }
 White(RunningTime(task)),
Exemple #14
0
 public void StoreRunningTime(RunningTime runningTime)
 => Repo <RunningTimeRepository>().AddOrUpdateDoCommit(runningTime);