Пример #1
0
        //public static SFOptimizationResults Parse(string i_StringToPrase, bool i_IsManaged = true)
        //{
        //    return Parse(i_StringToPrase, i_IsManaged, null);
        //}

        internal static SFOptimizationResults Parse(string i_StringToPrase, SFRefereceResolver i_ReferenceReslover)
        {
            if (string.IsNullOrWhiteSpace(i_StringToPrase))
            {
                throw new ArgumentNullException("i_StringToPrase");
            }

            SFOptimizationResults parsedOptimizationObjects = JsonConvert.DeserializeObject <SFOptimizationResults>(i_StringToPrase,
                                                                                                                    DeserializationUtils.SFJsonSerializerSettings);

            parsedOptimizationObjects.postDeserialization(i_ReferenceReslover);
            return(parsedOptimizationObjects);
        }
Пример #2
0
        internal SFOptimizationResults getPartialResults(int i_StartingIndex, int i_RemainingObjectsCount)
        {
            SFOptimizationResults partialResults = new SFOptimizationResults();

            partialResults.AssignedResourcesToDelete = getPartialList(AssignedResourcesToDelete, ref i_StartingIndex, ref i_RemainingObjectsCount);
            partialResults.BreaksToDelete            = getPartialList(BreaksToDelete, ref i_StartingIndex, ref i_RemainingObjectsCount);
            partialResults.Services = getPartialList(Services, ref i_StartingIndex, ref i_RemainingObjectsCount);
            partialResults.Absences = getPartialList(Absences, ref i_StartingIndex, ref i_RemainingObjectsCount);
            partialResults.AssignedResourcesToUpdate = getPartialList(AssignedResourcesToUpdate, ref i_StartingIndex, ref i_RemainingObjectsCount);
            partialResults.AssignedResourcesToCreate = getPartialList(AssignedResourcesToCreate, ref i_StartingIndex, ref i_RemainingObjectsCount);
            partialResults.BreaksToCreate            = getPartialList(BreaksToCreate, ref i_StartingIndex, ref i_RemainingObjectsCount);
            //partialResults.Statistics = Statistics;

            return(partialResults);
        }
        public void ParseResultsAndUpdateState(string i_StringToPrase)
        {
            SFOptimizationResults optimizationResults = SFOptimizationResults.Parse(i_StringToPrase, m_refereceResolver);

            updateListsInPlace(Breaks, optimizationResults.BreaksToDelete, optimizationResults.BreaksToCreate);
        }