<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Support Tools for Agricultural Production Simulation Processing</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Jan Pavlik</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Jiri Vanek</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Jan Masner</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Michal Stoces</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Vladimir Ocenasek</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Information Technologies, Faculty of Economics and Management, Czech University of Life Sciences Prague</institution>
          ,
          <country country="CZ">Czech Republic</country>
        </aff>
      </contrib-group>
      <fpage>468</fpage>
      <lpage>474</lpage>
      <abstract>
        <p>The APSIM software has proven to be extremely valuable decision support tool when it comes to optimizing agricultural management practices in order to maximize yield. Conducting high amount of simulations naturally requires processing of large volumes of data, therefore the available time and hardware resources create a limit for the scale of production simulation modelling. If APSIM is to be effectively used at a local level utilizing preexisting hardware infrastructure, an assessment of available resources must be conducted in order to optimize the scale of the simulation. Another issue is the availability of personnel with enough information technology skills and experience to conduct the processing. The focus of this paper are software automation and other assistance tools that are therefore required for production modelling to be successfully utilized by small to medium enterprises.</p>
      </abstract>
      <kwd-group>
        <kwd>APSIM</kwd>
        <kwd>scalability</kwd>
        <kwd>hardware requirements</kwd>
        <kwd>data processing</kwd>
        <kwd>automation software</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1 Introduction</title>
      <p>
        Maximizing yields of agricultural production is one the critical issues for society
today. Growing worldwide population exacerbates the need for sufficient food
production while increasing climate anomalies such as droughts can pose a great risk
for crops. One of the approaches to maintain and improve agricultural yields is to
utilize information technology to optimize managerial strategies and genotype
selection by conducting multi-factor analysis in form of simulations or modelling
        <xref ref-type="bibr" rid="ref2">(Holzworth et al., 2014)</xref>
        .
      </p>
      <p>
        The development of information technology hardware provides increasingly more
technological resources to conduct simulation processing on larger scales, however as
shown by
        <xref ref-type="bibr" rid="ref6">(Li and Li, 2014)</xref>
        the increase of available data, such as higher resolution of
geographical data, creates hardware limitations when scaling up the processing. This
is especially important when trying to utilize agricultural simulations on a local level,
for instance in small to medium agricultural companies. Due to the lack of financial
resources for purchasing dedicated hardware there is a need to utilize pre-existing
infrastructure. Most of the computing capacity in these companies is provided by out
of date machines, meaning that any large-scale data processing involving high level of
parallelization such as described by
        <xref ref-type="bibr" rid="ref11">(Zhao et al., 2013)</xref>
        is out of the question. The main
approach to utilize such hardware requires individual machine optimization alongside
parallelization as shown by
        <xref ref-type="bibr" rid="ref1">(Bartonek, 2017)</xref>
        . Another option would be to utilize cloud
computing, but as pointed out by
        <xref ref-type="bibr" rid="ref10 ref8">(Szufel, Czupryna and Kaminski, 2017)</xref>
        it necessary
to highly optimize cloud processing in order to maintain low costs.
      </p>
      <p>
        Second issue is the lack of qualified employees. Especially in agriculture there is a
distinct lack of IT proficient workers as pointed out by
        <xref ref-type="bibr" rid="ref8">(Reinmuth and Dabbert, 2017)</xref>
        .
This results in a need for easy to use support tools that would automate the simulation
setup and processing. Some of these tasks are already incorporated within the APSIM
software and as stated by
        <xref ref-type="bibr" rid="ref3">(Holzworth et al., 2018)</xref>
        the ease of use and focus on
automation will be one of the integral parts of next versions of APSIM.
      </p>
    </sec>
    <sec id="sec-2">
      <title>2 Simulation Workflow</title>
      <p>As shown in Figure 1, the main workflow of agricultural simulation processing can
be divided into four main steps. Firstly, it is necessary to establish the correct scale of
the processing. When adjusting the number of options for each factor, the total number
of simulations that needs to be processed changes accordingly. Since the number of
simulations is essentially a product of the number of varying options, restraining
variability only to the most relevant settings is the main way to reduce the processing
time.</p>
      <p>Fig 1. Basic simulation workflow</p>
      <p>The factors and options that are determined in this first stage can be for instance
different soil types, plant genotypes, different weather condition scenarios, and settings
involving various managerial practices such as time of sowing, time of harvest,
irrigation, fertilization, number of plants per meter square etc. (see Figure 2).
Fig 2. Basic concept of GxExM framework (genotype, environment, management)</p>
      <p>Second step is the data preparation and preprocessing. Each simulation is stored as
a single xml file. When APSIM is being deployed on dedicated hardware, is it possible
to generate these files “on the fly” during the processing. However as pointed out by
(Jarolimek et al., 2019) the hardware components, mainly processor and RAM,
constitute a limit on to how many simulations at once can APSIM handle. Therefore,
in order to maximize effectiveness, it is necessary to optimize simulation batch sizes
on a per machine basis, that is why the data preparation and preprocessing step is
unavoidable when trying to utilize sub-par preexisting hardware in smaller or medium
enterprises.</p>
      <p>The actual simulation processing itself should be conducted during downtimes such
as nights, when the infrastructure is not required for other critical operations. This part
is generally the most time consuming and therefore also the most likely to significantly
improve the overall efficiency if automation and scheduling is utilized. The hardware
dependence of the processing can result in bottlenecks if the previous two steps were
not conducted properly.</p>
      <p>The analysis of results is essentially a statistical data analysis and can therefore be
conducted using tools like MS Excel or more specialized software such as SAS,
STATISTICA etc. The most basic analysis would consist of simply taking the
simulations that produced highest yields and finding commonalities in the simulation
settings.</p>
    </sec>
    <sec id="sec-3">
      <title>3 Automation and support tools</title>
      <sec id="sec-3-1">
        <title>3.1 Simulation Settings</title>
        <p>The number of total simulations that needs to the processed determines the scale of
the processing. The calculation of the number of simulations is a simple multiplication
of options for each simulation settings. The scale can be therefore decreased or
increased by simply adjusting the number of options. When scaling up, it is possible
to include more options or “what-if” scenarios and generally explore more
combinations. When there is a need to scale down, the most likely best approach is to
use hands on experience of local producers or company agronomists to narrow down
the simulation option settings only to a few variations that were historically most
effective or make most sense in terms of the common local managerial practices.</p>
        <p>Therefore, the important question in step one is how many simulations we should
aim for. In order to properly select the scale of simulation an estimate must be made,
based on allotted time and the hardware available for the computation. And it is in this
point where the absence of experienced IT employees creates first problems. Unlike
bigger companies or corporations that might have dedicated IT departments, SMEs
generally lack specialists that would be able to adequately estimate the capabilities of
older hardware when it comes to processing large number of simulations.</p>
        <p>The support tools for this step could be a simple web application where the user
inputs basic hardware information of their machines including processing power and
RAM and the application will estimate number of simulations that can be run per day
or per hour.</p>
      </sec>
      <sec id="sec-3-2">
        <title>3.2 Data Preparation</title>
        <p>
          The main goal of this step is to gather all input information for the APSIM software.
There is a possibility for integration between APSIM and existing agricultural software
to partially automate this process, similar to that outlined by
          <xref ref-type="bibr" rid="ref9">(Skoogh, Michaloski and
Bengtsson, 2010)</xref>
          . Another option is to utilize integration to existing knowledge
databases such as soil or weather databases as explored by
          <xref ref-type="bibr" rid="ref5">(Kim et al., 2018)</xref>
          . But due
to the lower scale and therefore limited number of option settings, this is not necessary,
since manual entry of the input data is not very time consuming.
        </p>
        <p>The other part of preprocessing consists of generating the APSIM simulation files
beforehand and grouping them into various size batches optimized on a per machine
basis. The degree of detail this task needs to be performed to depends on the
sophistication of the software automation tools used in the following step. As shown
by (Pavlik et al., 2019) it is possible to develop an application that can combine some
of the work required in steps two and three and handle both the batch APSIM file
generation and the processing scheduling and automation.</p>
      </sec>
      <sec id="sec-3-3">
        <title>3.3 Simulation Processing</title>
        <p>There are four basic approaches to automate the simulation processing:
1. Use built-in APSIM capabilities
2. Process simulations ex-situ – on the cloud
3. Use existing software tools for automation
4. Develop new software specifically designed to automate APSIM simulations
As explained earlier, using existing APSIM options for automation might not be
possible due to the hardware limitations. Processing on the cloud is in essence similar
to purchasing dedicated hardware. It might be cheaper, but in this paper, we are
focusing mainly on exploiting already existing hardware and infrastructure. This
leaves us with options three and four.</p>
        <p>There are many existing software tools to automate tasks. Whether it be task
schedulers that already come with the operating system, or dedicated automation
software, such as HTCondor. The advantage of using such tools is that they include
many useful functions such as workload monitoring, virtualization, checkpointing and
can also combine serialized batch processing with parallelization. Therefore, this
option is preferable when used on hardware that also performs other day to day tasks.
The main disadvantage is that the previous and following steps (data preprocessing
and result analysis) will require more work since they cannot be incorporated into these
existing tools, not even partially.</p>
        <p>The last approach is to design and develop brand new tools specifically to automate
APSIM simulation processing. A custom-built tool could potentially encompass more
that just the processing automation. It can theoretically handle all four steps of the
workflow, bridging the gaps between the parts. This could be very valuable
considering the lack of experienced IT employees in smaller agricultural companies.
However, it will come at a cost of lower sophistication of automation and it will be
harder to combine the processing with other necessary tasks the hardware needs to
perform on a daily basis. This approach is therefore better suited for situations when
the company can set aside one or several computers, perhaps older or currently unused
machines, and fully use them towards the simulation processing.</p>
      </sec>
      <sec id="sec-3-4">
        <title>3.4 Analysis of Results</title>
        <p>If the analysis of the results is to be conducted in a separate statistical software, it is
necessary to convert the output simulation from the basic text format into .csv or .xsl.
This can be achieved with an extraction program or a script that will parse the output
files and siphon only the necessary data.</p>
        <p>However, when simulating agricultural production on a local level, the only
important outputs are the simulation settings associated with the highest yields. A
complex statistical analysis may therefore not be necessary. In case of developing new
custom software for the previous processing steps, the extraction of yield data,
selection of top simulations and any eventual visualization of simulation settings can
be added to it, resulting in an overarching support tools that can automate vast majority
of the workflow processes.</p>
        <p>The paper discussed two main approaches to conducting agricultural production
simulations in smaller or medium companies. The first approach is to split the process
into logical parts and optimize and automate them separately, utilizing either already
existing software tools, or developing a smaller programs for individual tasks, such as
format conversion tools, simulation generation tools, data parsers etc. The main
advantages of this approach are higher optimization and better interoperability when
utilizing existing hardware that cannot be fully dedicated to the task. However, such a
solution would require employee skilled in IT, prompting additional need for financial
resources in order to hire or train someone.</p>
        <p>The second approach consists of developing an overarching support tool that would
incorporate all the various processing tasks. If developed as a general purpose
streamlined software with focus on ease of use, it could overcome the problem with
lack of experienced IT workers in small to medium companies. The disadvantages of
this solution are harder incorporation with existing agricultural software running
parallel on the same machines and loss of modularity options such as in-depth data
analysis or conducting simulations for goals other than maximizing yields.
Acknowledgment: The results and knowledge included herein have been obtained
owing to support from the following institutional grant. Internal Grant Agency of the
Faculty of Economics and Management, Czech University of Life Sciences in Prague,
grant no. 2019MEZ0005 – “Optimization of management practices in sorghum
production under uncertain future weather conditions”.</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Bartonek</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          <article-title>The Possibilities of Big GIS Data Processing on the Desktop Computers (</article-title>
          <year>2017</year>
          ).
          <source>RISE OF BIG SPATIAL DATA Book Series: Lecture Notes in Geoinformation and Cartography</source>
          , pp.
          <fpage>273</fpage>
          -
          <lpage>287</lpage>
          . DOI:
          <volume>10</volume>
          .1007/978-3-
          <fpage>319</fpage>
          -45123- 7_
          <fpage>20</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Holzworth</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Huth</surname>
            ,
            <given-names>N. I.</given-names>
          </string-name>
          , de Voil,
          <string-name>
            <given-names>P. G.</given-names>
            ,
            <surname>Zurcher</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E. J.</given-names>
            ,
            <surname>Herrmann</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N. I.</given-names>
            ,
            <surname>McLean</surname>
          </string-name>
          ,
          <string-name>
            <surname>G.</surname>
          </string-name>
          et al. (
          <year>2014</year>
          )
          <article-title>“APSIM - Evolution towards a New Generation of Agricultural Systems Simulation</article-title>
          .”
          <source>Environmental Modelling &amp; Software</source>
          , Vol.
          <volume>62</volume>
          , pp.
          <fpage>327</fpage>
          -
          <lpage>350</lpage>
          . ISSN 1364-
          <fpage>8152</fpage>
          . DOI 10.1016/j.envsoft.
          <year>2014</year>
          .
          <volume>07</volume>
          .009.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Holzworth</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Huth</surname>
            ,
            <given-names>N. I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fainges</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Brown</surname>
          </string-name>
          , H.,
          <string-name>
            <surname>Zurcher</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cichota</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Verrall</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Herrmann</surname>
            ,
            <given-names>N. I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zheng</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Snow</surname>
          </string-name>
          . V. (
          <year>2018</year>
          )
          <article-title>“APSIM Next Generation: Overcoming Challenges in Modernising a Farming Systems Model”</article-title>
          ,
          <source>Environmental Modelling &amp; Software</source>
          , Vol.
          <volume>103</volume>
          , pp.
          <fpage>43</fpage>
          -
          <lpage>51</lpage>
          . ISSN 1364-
          <fpage>8152</fpage>
          . DOI 10.1016/j.envsoft.
          <year>2018</year>
          .
          <volume>02</volume>
          .002
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Jarolímek</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pavlík</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kholova</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Ronanki</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          (
          <year>2019</year>
          )
          <article-title>“Data Pre-processing for Agricultural Simulations“</article-title>
          ,
          <source>AGRIS on-line Papers in Economics and Informatics</source>
          , Vol.
          <volume>11</volume>
          , No.
          <issue>1</issue>
          , pp.
          <fpage>49</fpage>
          -
          <lpage>53</lpage>
          . ISSN 1804
          <article-title>-1930</article-title>
          . DOI 10.7160/aol.
          <year>2019</year>
          .110105
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Kim</surname>
            ,
            <given-names>K. S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Yoo</surname>
            ,
            <given-names>B. H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Shelia</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Porter</surname>
            ,
            <given-names>C. H.</given-names>
          </string-name>
          <article-title>and</article-title>
          <string-name>
            <surname>Hoogenboom</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          (
          <year>2018</year>
          )
          <article-title>“START: A data preparation tool for crop simulation models using web-based soil databases”, Computers and Electronics in Agriculture</article-title>
          , vol.
          <volume>154</volume>
          , pp.
          <fpage>256</fpage>
          -
          <lpage>264</lpage>
          . ISSN 0168-
          <fpage>1699</fpage>
          . DOI 10.1016/j.compag.
          <year>2018</year>
          .
          <volume>08</volume>
          .023
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Li</surname>
            ,
            <given-names>Q.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Li</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          <article-title>Big data GIS (</article-title>
          <year>2014</year>
          ).
          <article-title>Wuhan Daxue Xuebao (Xinxi Kexue Ban)/Geomatics</article-title>
          and Information Science of Wuhan University, vol.
          <volume>39</volume>
          ,
          <issue>iss</issue>
          . 6, pp.
          <fpage>641</fpage>
          -
          <lpage>644</lpage>
          +
          <fpage>666</fpage>
          . DOI:
          <volume>10</volume>
          .13203/j.whugis20140150
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Pavlík</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Masner</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Jarolímek</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lukáš</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          (
          <year>2019</year>
          )
          <article-title>“Data Processing for Yield Optimization“</article-title>
          ,
          <source>Agrarian perspectives XXVIII</source>
          . - Business Scale in Relation to Economics, pp.
          <fpage>189</fpage>
          -
          <lpage>193</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Reinmuth</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Dabbert</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          (
          <year>2017</year>
          ) “
          <article-title>Toward more efficient model development for farming systems research - An integrative review”, Computers And Electronics In Agriculture</article-title>
          , Vol.
          <volume>138</volume>
          , pp.
          <fpage>29</fpage>
          -
          <lpage>38</lpage>
          . ISSN 0168-
          <fpage>1699</fpage>
          . DOI 10.1016/j.compag.
          <year>2017</year>
          .
          <volume>04</volume>
          .007
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Skoogh</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Michaloski</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bengtsson</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          <article-title>Towards continuously updated simulation models: Combining automated raw data collection</article-title>
          and
          <source>automated data processing (</source>
          <year>2010</year>
          ).
          <source>Winter Simulation Conference</source>
          , pp.
          <fpage>1678</fpage>
          -
          <lpage>1689</lpage>
          . DOI:
          <volume>10</volume>
          .1109/WSC.
          <year>2010</year>
          .5678901
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Szufel</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Czupryna</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Kaminski</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          (
          <year>2017</year>
          )
          <article-title>"Optimal execution of large scale simulations in the cloud. The case of route-To-pa sim online preference simulation“</article-title>
          ,
          <source>Proceedings - Winter Simulation Conference</source>
          , pp.
          <fpage>3702</fpage>
          -
          <lpage>3703</lpage>
          . DOI 10.1109/WSC.
          <year>2016</year>
          .
          <volume>7822408</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Zhao</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bryan</surname>
            ,
            <given-names>B. A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>King</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Luo</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wang</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bende-Michl</surname>
            ,
            <given-names>U.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Song</surname>
            ,
            <given-names>X.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Yu</surname>
            ,
            <given-names>Q.</given-names>
          </string-name>
          (
          <year>2013</year>
          ) “
          <article-title>Large-scale, high-resolution agricultural systems modeling using a hybrid approach combining grid computing and parallel processing”</article-title>
          ,
          <source>Environmental Modelling &amp; Software</source>
          , Vol.
          <volume>41</volume>
          , pp.
          <fpage>231</fpage>
          -
          <lpage>238</lpage>
          . ISSN 1364-
          <fpage>8152</fpage>
          . DOI 10.1016/j.envsoft.
          <year>2012</year>
          .
          <volume>08</volume>
          .007
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>