1 / 18

A Framework for Agricultural Model Development

A Framework for Agricultural Model Development. Kei Tanaka NARC-NARO. Contents of Presentation. Background of model development Framework Efficiency of using framework Conclusions. Background of Agricultural Model Development. Developed several agricultural models

jamesrsmith
Download Presentation

A Framework for Agricultural Model Development

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. A Framework for Agricultural Model Development Kei Tanaka NARC-NARO

  2. Contents of Presentation • Background of model development • Framework • Efficiency of using framework • Conclusions

  3. Background of Agricultural Model Development • Developed several agricultural models • Plant growth models (rice, pear, …) • Disease prediction models (wheat, pear, …) • Executable in an web pagehttp://cse.naro.affrc.go.jp/ketanaka/model/

  4. Java • APIs: Network, GUI, … • Cross-platform: Windows, Linux, Mac OS, … • Applet: If JRE is installed, additional installation work is not necessary. • Execution easily is important to popularize a model • Secure programming

  5. MetBroker • A middleware between weather databases and agricultural models • Provides consistent methods to access various weather databases through the Internet

  6. Framework • Framework • Program library summarized to reuse for the specific purpose application. • Advantages of using a Framework • Offers implementation→ Development productivity improves • Specifies a development method→ Quality of application is kept high

  7. Frameworks • Web MVC • Struts, Tapestry, JSF, Spring MVC, Web Work • O/R Mapping • Hibernate, PriDE, O/R Broker, Mr.Persister • Testing • JUnit, TestNG, JTiger • SOA (Service Oriented Architecture) • Celtix, Beehive, JBoss jBPM

  8. Common Features of Agricultural Models • Management of data • Sequential value: Air Temp., Rain, … • Numerical value: Weight, Threshold, … • Date: Transplant date, … • Boolean value: Use or Not use • Weather data acquisition from a MetBroker or a user’s local file • Result display in a table or a chart

  9. Example 1 Data Source Setup import net.agmodel.data.*; import net.agmodel.datareader.*; … public class PearDuthieData extends ExecutionDataImpl{ public BlastamData(){ //Setup for parameters and sequential data addValueElement(LEAF_WETNESS_THRESHOLD); //Declaration of a parameter setValue_(LEAF_WETNESS_THRESHOLD, 80.0); //Set of the initial value of a parameter addSequenceElement(AIRTEMPERATURE); //Declaration of a sequential data addSequenceElement(LEAFWETNESS); DataSourceAttribute dsAttrAirTemp = getDataSourceAttribute(AIRTEMPERATURE); DataSourceAttribute dsAttrLeafWet = getDataSourceAttribute(LEAFWETNESS); //Set of the data source of sequential data dsAttrAirTemp.addUsableDataSource(DataSourceElement.MET_BROKER); //MetBroker dsAttrAirTemp.addUsableDataSource(DataSourceElement.USER_DATA); //User Data dsAttrLeafWet.addUsableDataSource(DataSourceElement.MET_BROKER); dsAttrLeafWet.addUsableDataSource(DataSourceElement.USER_DATA); dsAttrLeafWet.addUsableDataSource(DataSourceElement.ESTIMATED_DATA); //Estimated Data … } public UserDataReader getUserDataReader(){ //Setup to aquire user’s local file data UserDataReaderImpl udReader = new UserDataReaderImpl(); udReader.addTextDataElement(new TextDataElement(AIRTEMPERATURE, AIRTEMPERATURE.toString(), "C")); udReader.addTextDataElement(new TextDataElement(LEAFWETNESS, LEAFWETNESS.toString(), "")); return udReader; } … }

  10. public class PearDuthieData extends ExecutionDataImpl{ public BlastamData(){ addValueElement(LEAF_WETNESS_THRESHOLD); setValue_(LEAF_WETNESS_THRESHOLD, 80.0); addSequenceElement(AIRTEMPERATURE); addSequenceElement(LEAFWETNESS); DataSourceAttribute dsAttrAirTemp = getDataSourceAttribute(AIRTEMPERATURE); DataSourceAttribute dsAttrLeafWet = getDataSourceAttribute(LEAFWETNESS); //Set of the data source of sequential data dsAttrAirTemp.addUsableDataSource(DataSourceElement.MET_BROKER); dsAttrAirTemp.addUsableDataSource(DataSourceElement.USER_DATA); dsAttrLeafWet.addUsableDataSource(DataSourceElement.MET_BROKER); dsAttrLeafWet.addUsableDataSource(DataSourceElement.USER_DATA); dsAttrLeafWet.addUsableDataSource(DataSourceElement.ESTIMATED_DATA); … } public UserDataReader getUserDataReader(){ //Setup to aquire user’s local file data UserDataReaderImpl udReader = new UserDataReaderImpl(); udReader.addTextDataElement(new TextDataElement(AIRTEMPERATURE, AIRTEMPERATURE.toString(), "C")); udReader.addTextDataElement(new TextDataElement(LEAFWETNESS, LEAFWETNESS.toString(), "")); return udReader; } … }

  11. Example 2 Result Display public class PearDuthieTableUI extends net.agmodel.gui.ModelTableFrame{ //Display result data in a table protected SequenceTM[] createSequenceTM(ResultData data){ JigsawQuantityFormat jqf = new JigsawQuantityFormat("0", DEVOID); //Number format to display Sequence wetness = data.getSequence(WETNESS_DURATION); Sequence infection = data.getSequence(INFECTION_RATE); return new SequenceTM[]{ //Array of sequential data displayed in a table new SequenceTM((MetSequence)data.getSequence(AIRTEMPERATURE)), new SequenceTM((MetSequence)data.getSequence(LEAFWETNESS)), new SequenceTM(data.getSequence(WETNESS_DURATION), WETNESS_DURATION.toString(), "h", SummaryKind.AVERAGE, jqf), new SequenceTM(data.getSequence(INFECTION_RATE), INFECTION_RATE.toString(), "", SummaryKind.MAXIMUM, jqf)}; } //Display result data in a chart protected SequenceC[] createSequenceC(ResultData data){ Interval in = data.getResultInterval(); Duration re = data.getResolution(); return new SequenceC[]{ //Array of sequential data displayed in a chart new SequenceC((MetSequence)data.getSequence(AIRTEMPERATURE), in, re), new SequenceC((MetSequence)data.getSequence(LEAFWETNESS), in, re), new SequenceC(new SequenceU(data.getSequence(INFECTION_RATE), SummaryKind.MAXIMUM), INFECTION_RATE.toString(), null, null, in, re)}; } //Display result data in a map protected net.agmodel.gui.MultipleStationResultMap createMap(double latitude, double longitude){ return new PearDuthieMap((ResultData[])allData, latitude, longitude, 1000000, INFECTION_RATE.toString()); } }

  12. public class BlastamTableUI extends net.agmodel.gui.ModelTableFrame{ //Display result data in a table protected SequenceTM[] createSequenceTM(ResultData data){ //Number format to display JigsawQuantityFormat jqf = new JigsawQuantityFormat("0", DEVOID); //Array of sequential data displayed in a table return new SequenceTM[]{ new SequenceTM((MetSequence)data.getSequence(AIRTEMPERATURE)), new SequenceTM((MetSequence)data.getSequence(RAIN)), new SequenceTM((MetSequence)data.getSequence(WIND)), new SequenceTM((MetSequence)data.getSequence(SUNSHINE))}; } //Display result data in a chart protected SequenceC[] createSequenceC(ResultData data){ Interval in = data.getResultInterval(); Duration re = data.getResolution(); return new SequenceC[]{ //Array of sequential data displayed in a chart new SequenceC((MetSequence)data.getSequence(AIRTEMPERATURE), in, re), new SequenceC((MetSequence)data.getSequence(RAIN), in, re), new SequenceC((MetSequence)data.getSequence(WIND), in, re), new SequenceC((MetSequence)data.getSequence(SUNSHINE), in, re)}; } //Display result data in a map protected net.agmodel.gui.MultipleStationResultMap createMap(double latitude, double longitude){ return new BlastamMap((ResultData[])allData, latitude, longitude, 1000000, INFECTION_RATE.toString()); } }

  13. public class BlastamTableUI extends net.agmodel.gui.ModelTableFrame{ //Display result data in a table protected SequenceTM[] createSequenceTM(ResultData data){ //Number format to display JigsawQuantityFormat jqf = new JigsawQuantityFormat("0", DEVOID); //Array of sequential data displayed in a table return new SequenceTM[]{ new SequenceTM((MetSequence)data.getSequence(AIRTEMPERATURE)), new SequenceTM((MetSequence)data.getSequence(RAIN)), new SequenceTM((MetSequence)data.getSequence(WIND)), new SequenceTM((MetSequence)data.getSequence(SUNSHINE))}; } //Display result data in a chart protected SequenceC[] createSequenceC(ResultData data){ Interval in = data.getResultInterval(); Duration re = data.getResolution(); //Array of sequential data displayed in a chart return new SequenceC[]{ new SequenceC((MetSequence)data.getSequence(AIRTEMPERATURE), in, re), new SequenceC((MetSequence)data.getSequence(RAIN), in, re), new SequenceC((MetSequence)data.getSequence(WIND), in, re), new SequenceC((MetSequence)data.getSequence(SUNSHINE), in, re)}; } //Display result data in a map protected net.agmodel.gui.MultipleStationResultMap createMap(double latitude, double longitude){ return new BlastamMap((ResultData[])allData, latitude, longitude, 1000000, INFECTION_RATE.toString()); } }

  14. public class BlastamTableUI extends net.agmodel.gui.ModelTableFrame{ //Display result data in a table protected SequenceTM[] createSequenceTM(ResultData data){ //Number format to display JigsawQuantityFormat jqf = new JigsawQuantityFormat("0", DEVOID); //Array of sequential data displayed in a table return new SequenceTM[]{ new SequenceTM((MetSequence)data.getSequence(AIRTEMPERATURE)), new SequenceTM((MetSequence)data.getSequence(RAIN)), new SequenceTM((MetSequence)data.getSequence(WIND)), new SequenceTM((MetSequence)data.getSequence(SUNSHINE))}; } //Display result data in a chart protected SequenceC[] createSequenceC(ResultData data){ Interval in = data.getResultInterval(); Duration re = data.getResolution(); return new SequenceC[]{ //Array of sequential data displayed in a chart new SequenceC((MetSequence)data.getSequence(AIRTEMPERATURE), in, re), new SequenceC((MetSequence)data.getSequence(RAIN), in, re), new SequenceC((MetSequence)data.getSequence(WIND), in, re), new SequenceC((MetSequence)data.getSequence(SUNSHINE), in, re)}; } //Display result data in a map protected net.agmodel.gui.MultipleStationResultMap createMap(double latitude, double longitude){ return new BlastamMap((ResultData[])allData, latitude, longitude, 1000000, INFECTION_RATE.toString()); } }

  15. Agricultural Models developed by using Framework

  16. Efficiency of using Framework • MetBLASTAM (Rice blast forecasting model) • 2,000 lines was developed for the model • 25,000 lines provided by the framework was called from the model program • Calculation part (main part of the model) is 45% of the model program→ Developer can use much time to develop main part, not Data acquisition, GUI.

  17. Conclusions • Developed the framework for agricultural models • Several models developed by using the framework • Program for weather data acquisition and result display only lists data names • Model developer can use much time to develop main part

More Related