Example #1
0
        /* public InputSynthese(DateTime date1, DateTime date2, string wilaya)
         * {
         *   this.date1 = date1;
         *   this.date2 = date2;
         *   this.path=defaultpath + @"\" + wilaya + ".csv";
         *   this.dataset = new ManipDS(path);
         *   this.periode = dataset.requetteAIntervalle(date1, date2);
         * }*/

        public InputSynthese(DateTime date1, DateTime date2, string path)
        {
            this.date1   = date1;
            this.date2   = date2;
            this.path    = path;
            this.dataset = new ManipDS(path);
            this.periode = dataset.requetteAIntervalle(date1, date2);
        }
Example #2
0
        public void SetObservationTable()
        {
            _datatSet = new ManipDS(_path);

            //Le partie du dataset contenant tous les observations de la meme saison
            _donnees = _datatSet.getSaison(saison);

            _donneesSaisonSuivante = _datatSet.getSaison(
                ((saison + 1) > Saison.automne) ? (Saison.hiver) : (saison + 1) //gestion d'une erreur
                );                                                              //et la saison suivante


            //************************************
            //_donnees = FilterToDays(_donnees);
            //_donneesSaisonSuivante = FilterToDays(_donneesSaisonsSuivante);
            //************************************

            // having the number of all observations, Initilizing the observation table.
            observationsTable = new List <PredictionCouple>(_donnees.Count);

            int delay = query.Duration;
            int numberOfParameters = query.ParameterKeys.Count;

            //****By tha way, knowing that the attributes in the application are different from
            //those in the dataset, so we need a conversion. (Line: 115)



            foreach (Observation observation in _donnees)
            {
                //Allocating new space for the double table
                List <double> pastList   = new List <double>(numberOfParameters);
                List <double> futureList = new List <double>(numberOfParameters);

                foreach (string key in query.ParameterKeys)
                {
                    //**DEBUG ONLY****
                    //Console.WriteLine("Key : " + key + " in ds : " + consideredWilaya.getAttr(key) + " value of the 1st obs : " + observation
                    //  .getDonnee(consideredWilaya.getAttr(key)) + " Datetime" + observation.GetDate().ToString());
                    //Console.Read();
                    //****************


                    //Filling the tables of doubles,
                    //TODO: Expections: key might not exist in the Dictionnary
                    pastList.Add(observation.getDonnee(
                                     consideredWilaya.getAttr(key)
                                     ));

                    try
                    {
                        futureList.Add(
                            _donnees[_donnees.IndexOf(observation) + delay].getDonnee(
                                consideredWilaya.getAttr(key)
                                ));
                    }
                    catch (ArgumentOutOfRangeException e)
                    {
                        //If we go beyond the first list of the current season we will get those in the next season
                        futureList.Add(
                            _donneesSaisonSuivante[_donnees.Count - _donnees.IndexOf(observation)].getDonnee(
                                consideredWilaya.getAttr(key)
                                ));
                    }
                    catch (Exception e)
                    {
                        Console.Write(e);
                        throw;
                    }
                }

                double[] past   = new double[numberOfParameters];
                double[] future = new double[numberOfParameters];
                past   = pastList.ToArray();
                future = futureList.ToArray();

                observationsTable.Add(new PredictionCouple(past, future));
            }
        }
Example #3
0
 public void SetPath2(String path)
 {
     path2         = path;
     this.dataset2 = new ManipDS(path2);
     this.periode2 = dataset2.requetteAIntervalle(date1, date2);
 }
Example #4
0
        /* public InputSynthesePrime () : base()
         * {
         *   path2 = base.defaultpath + @"\ADRAR.csv";
         *   this.dataset2 = new ManipDS(path2);
         *   this.periode2 = dataset2.requetteAIntervalle(date1, date2);
         * }*/

        public InputSynthesePrime(DateTime date1, DateTime date2, string path1, string path2) : base(date1, date2, path1)
        {
            this.path2    = path2;
            this.dataset2 = new ManipDS(path2);
            this.periode2 = dataset2.requetteAIntervalle(date1, date2);
        }
Example #5
0
        /*public InputSynthese()
         * {
         *  date1 =  date2 = DateTime.Today;
         *  path = defaultpath+ @"\ADRAR.csv";
         *  this.dataset = new ManipDS(path);
         *  this.periode = dataset.requetteAIntervalle(date1, date2);
         * }*/

        public void SetPath(String path)
        {
            this.path    = path;
            this.dataset = new ManipDS(path);
            this.periode = dataset.requetteAIntervalle(date1, date2);
        }