Esempio n. 1
0
        /// Public Methods Section


        ///<summary>
        ///
        /// Entry Point of prediction ,requires all systems Initilized and requires DailyMeteoSystem to have a non null observation
        ///
        /// </summary>
        public void StartPrediction()
        {
            if (dailyMeteoSystem.Observation != null)
            {
                predictionManager.DailyObservation = dailyMeteoSystem.Observation;


                queryManager.GenerateQuery(dailyMeteoSystem.Observation);
                PredictionCouple.NUMBER_OF_PARAMETERS = dailyMeteoSystem.Observation.Parameters.Count;


                /// Getting data from dataSet
                dataRetreiver.SetQuery(queryManager.Query);
                dataRetreiver.HandleQuery();
                dataRetreiver.SetObservationTable();
                predictionManager.PredictionCouples = dataRetreiver.GetObservations();
                ///
                if (predictionManager.PredictionCouples != null && mode == CEP)
                {
                    predictionManager.PredictByKNN();
                    resultHandler.Predictions = predictionManager.Predictions;
                    resultHandler.GenerateResults();
                    if (resultHandler.Results != null)
                    {
                        foreach (var prediction in resultHandler.Results)
                        {
                            decisionMaker.SetPredictions(prediction.Predictions);
                            prediction.Climate = decisionMaker.GetDecision();
                        }
                    }
                }
                else if (mode == SELECTION)
                {
                    resultHandler.SetResults(predictionManager.PredictBySelection());
                    if (resultHandler.Results != null)
                    {
                        foreach (var prediction in resultHandler.Results)
                        {
                            decisionMaker.SetPredictions(prediction.Predictions);
                            prediction.Climate = decisionMaker.GetDecision();
                        }
                    }
                }
            }
            else
            {
                throw new NullObservationException("DailyMeteoSystem Has not yet acquired Observation");
            }
        }