Example #1
0
 public static IEnumerable<TabularModel> GetTabularForecast(string stationName, DateTime setDate, double airPollutionLevel)
 {
     PredictWeather obj = new PredictWeather();
     var list=( from c in obj.prediction(setDate,stationName,airPollutionLevel)  select new TabularModel
                     {
                         WeatherDate = c.date.ToString(),
                         Station = c.station,
                         AirPolutionLevel = c.airPollutionLevel,
                         MaxTemp = c.maxTemp,
                         MinTemp = c.minTemp,
                         RainFall = c.rainfall
                     }
                         ).ToList();
     return list;
 }
Example #2
0
        public static object[][] GetDataForForecastBaseLineChart(string stationName, DateTime setDate, double airPollutionLevel)
        {
            object[][] value = new object[4][];
            for (int x = 0; x < value.Length; x++) {

            value[x]=new object[30];
            }
            PredictWeather obj = new PredictWeather();
            var list = obj.prediction(setDate, stationName, airPollutionLevel);

            var i = 0;
            foreach (var item in list)
            {
                value[0][i] = item.minTemp;
                value[1][i] = item.maxTemp;
                value[2][i] = item.rainfall;
                i++;

            }
            return value;
        }
Example #3
0
 static void Main(string[] args)
 {
     PredictWeather predict = new PredictWeather();
     //set true to train
         predict.run(true);
 }