Ejemplo n.º 1
0
    public void generateNewTempForecast()
    {
        forecastTemp = new QueueDirectAccess <float>();
        forecastTemp.resize(daysToForecast);

        int daysInSeasons    = climate.getDaysPerSeason();
        int seasonsInClimate = climate.getSeasonsInClimate();

        int dayInForecast    = currentDay;
        int seasonInForecast = currentSeason;

        for (int i = 0; i < daysToForecast; i++)
        {
            if (dayInForecast == daysInSeasons)
            {
                dayInForecast = 0;
                seasonInForecast++;

                if (seasonInForecast == seasonsInClimate)
                {
                    seasonInForecast = 0;
                }
            }

            float temperature = climate.getTempFromSeasonAndDay(seasonInForecast, dayInForecast);
            forecastTemp.enqueue(temperature);

            dayInForecast++;
        }
    }