예제 #1
0
        /// <summary>
        /// Saves cycle information to database and updates with the score
        /// </summary>
        /// <param name="cycleId">Unique identifier of the Cycle</param>
        /// <param name="cycleScore">Score the engine attained this cycle</param>
        public void ScoreCycle(long cycleId, double cycleScore)
        {
            CurrentCase.CycleScore = cycleScore;

            // add to best solution staging
            var bsol = new BestSolution()
            {
                RneuronId    = CurrentCase.Rneuron_ID,
                SolutionId   = CurrentCase.Solution_ID,
                CycleOrder   = CurrentCase.Order, //CurrentCase.CycleEndTime,
                CycleScore   = CurrentCase.CycleScore,
                SessionScore = double.MinValue
            };

            MemoryManager.BestSolutionStaging.Add(bsol);

            //save case to db
            if (PersistData)
            {
                MemoryManager.AddCaseToQueue(cycleId, CurrentCase);
            }

            CurrentCase = null;
            bsol        = null;
        }