This Project is a prototype of a program which articially simulates the weather and outputs weather data in a standard format for a game to read.
This project uses sliding window algorithm.
Sliding window algorithm - Mean of current year last week data is calcualted. Also, sliding window is identified for last year 14 days data. Mean is calculated for each sliding window. Best Matching mean between current year and slinding window is selected on the basis of proximity of the data. Then the last year date is identified on the basis of selected mean. This identified date data is replicated for the prediction date.
We have used batch pocessing which takes 2 parameters - the start date and number of records to be generated. It iterates the next date starting from 'the start date' and keep incrementing the date till the 'number of records' limit is reached.
Software libraries used are jdk1.8.0_144, log4j-1.2.17 and junit-4.11.
Softwares required : jre1.8.0_144
For Production :
- Go to https://github.com/SimplBrains/CBA_Weather_Demo and download 'WeatherDataGenerator_lib', 'WeatherDataGenerator.jar' and 'program_caller.sh'
- Place these three files in one folder and place it in any machine with Java platform.
- Call command - 'sh program_caller.sh'.
For Development :
- Go to https://github.com/SimplBrains/CBA_Weather_Demo and download 'WeatherDataGenerator'. This is workspace.
- Import the workspace in Eclipse.
- run 'com.subals.service.main.BatchHandlerMain.java'.
Please find the class diagram at location : https://github.com/SimplBrains/CBA_Weather_Demo/blob/master/WeatherDataGeneratorClass%20Diagram.png
1.BatchHandlerMain - Invokes the process and generate weather prediction from previous year history data.
2.TodayPredictorMain - Invokes the process and generate weather prediction for current date(i.e. today).(for debug/future used utility)
3.MeanCalculator - calculates the mean of current year previous week and last year sliding window mean. Return these mean values.
4.MeanComparator - compares the mean of current year previous week and last year sliding window mean and find best window. Find start date of best window and returns the same.
5.ConditionDefiner - defines condition of weather based on temperature, pressure and humidity.
6.ReadCSV - Read record of type WeatherInfo from a file with .csv extension.
7.WriteCSV - Writes record of type WeatherInfo to a file with .csv extension.
8.WeatherInfo - Bean class for data source parameter.
For Testing :
- Go to https://github.com/SimplBrains/CBA_Weather_Demo and download 'WeatherDataGenerator'. This is workspace.
- Import the workspace in Eclipse.
- run 'com.subals.test.testall.TestAll' in 'test' folder as junit.
Kumar Abhishek - https://www.linkedin.com/in/kumar-abhishek-857a8b8/
This code belongs to Kumar Abhishek, NSR Registration : 741068199096. Any use, modification without his permission is strictly prohibited.