An overview of model iteration |
|
|
Release 9.2
Last modified November 9, 2006 |
Print all topics in : "Model Iteration" |
Iteration means to repeat a process and is sometimes referred to as looping. Iteration is a key concept in most programming languages. With iteration, you execute a process over and over using different data in each iteration.
In ModelBuilder, you can use iteration to cause the entire model to iterate, or just iterate an individual process.
Batch processing is one way to iterate an entire model using different data for each iteration. With batch processing, you use the batch grid to provide data and values for every model parameter for each iteration of the model.
Learn more about batch processing and the batch grid
Batch processing is available from ArcToolbox but not within ModelBuilder. In ModelBuilder, you can use several methods to cause a process or model to iterate. These methods are described in general below. The subtopics that follow show you the mechanics of declaring Lists and Series, setting up a model for iteration, iteration variables, and feedback.
In ModelBuilder, right-click any variable and click Properties. Click the appropriate button to declare the variable as either A single value (the default), A list of values, or A series of values.
From the Model menu in ModelBuilder, click Model Properties and click the Iteration tab. Here is where you specify that you want the entire model to iterate using a count or Boolean condition.
Feedback is where the output of a process is made the input to an earlier process. You can declare a variable as feedback by opening the properties of the input variable and selecting the output variable that will feed back as the input, as shown below. You can also use the Connect tool
and connect an output variable to feed back to an input variable.
ModelBuilder provides two variables that contain the current iteration number and the current list index.
%i%— the current position, or index, in a list variable. The first position is zero.
%n%— the current model iteration. The first iteration is zero.
You can use these variables in calculations and pathnames. For example, the pathname of an output dataset might be:
E:/Data/Result%i%_%n%