Esempio n. 1
0
        private void simulateOneHour()
        {
            var sw = new Stopwatch();

            sw.Start();

            if (ProjectByCreationTimeInHours.TryGetValue(HoursElapsed, out var projects))
            {
                foreach (var project in projects)
                {
                    var problem = CreatePlanSelectionProblem(project);
                    var plans   = problem.SuggestPlans(out _);

                    project.Plans = plans;

                    if (plans.Length > 0)
                    {
                        scheduleWork(plans[0], HoursElapsed, project.Id);
                    }
                }
            }

            if (HoursElapsed > 0 && HoursElapsed % ExecutorsEconomicBehaviour.PaymentRateUpdatingIntervalHours == 0)
            {
                updatePaymentRates(HoursElapsed);
            }

            sw.Stop();

            _log.Debug($"Hour {HoursElapsed} modeled in {sw.ElapsedMilliseconds} ms");
        }