Assigning evaluators
Network elements are created from source features; network attributes—such as cost and hierarchy attributes—hold values for the network elements; and an evaluator calculates the values of attributes for elements created from a particular source feature class. This means that a single network element has several evaluators; for example, a single cost attribute on a multimodal network could have an evaluator for each of the source feature classes, such as streets, railroads, walkways, turns, and junctions.
This topic describes how to set up evaluators.
- Open the Network Dataset Properties dialog box.
-
Click the Attributes tab.
The network dataset in the graphic below has four network attributes: Meters, Minutes, Oneway, and RoadClass.
-
Choose the attribute that needs to have its evaluators modified and click Evaluators.
The Evaluators dialog box opens.
-
Follow these substeps to assign a field evaluator to a source, or skip to the next step for directions on how to add an expression to a field evaluator:
- Under the Type column, click the source row and click Field.
- Under the Value column, click the source row and click the correct field from the list.
The following graphic shows a field evaluator for a Streets feature class in the to-from digitized direction of the source features:
Tip:
You can assign values for the Type and Value columns at the same time. To assign Type values, press the CTRL or SHIFT key while you click the rows in the Attribute Values table. Right-click one of the selected rows, click Type, then choose the desired evaluator type.
Similarly, you can assign the same value to the Value column for multiple rows. To do this, select two or more rows; right-click one of the selected rows, pointing to Value; then click Properties. The settings you specify on the dialog box that opens are assigned to all the selected rows in the Attribute Values table of the Evaluators dialog box.
-
Follow these substeps to assign a field expression evaluator to a source, or skip to the next step for directions regarding another evaluator:
- Under the Type column, click the source row and click Field.
-
Click the Evaluator Properties button
.
- On the Field Evaluators dialog box, choose whether your expression will be written in VBScript or Python. VBScript is recommended for faster performance; however, you will need to use Python if you plan to build the network dataset with ArcGIS for Server (Linux).
- Type the expression.
- Click OK.
-
Follow these substeps to assign a constant evaluator to a source, or skip to the next step for directions regarding another evaluator:
- Under the Type column, click the source row and choose Constant from the drop-down list.
-
Under the Value column, click the source row and choose Ignore Restriction or Use Restriction for restriction attributes, or enter a numeric value for cost, descriptor, and hierarchy attributes.
The following graphic shows a constant evaluator for a restriction attribute on a Turns source feature class:
-
Follow these substeps to assign a script evaluator to a source, or skip to the next step for directions regarding another evaluator:
- Under the Type column, click the source row and click Script.
-
Click the Evaluator Properties button
.
- On the Script Evaluators dialog box, choose whether your script will be written in VBScript or Python. VBScript is recommended for faster performance; however, you will need to use Python if you plan to solve a network analysis with ArcGIS for Server (Linux).
- Type a script.
- Click OK.
In this example, a restriction network attribute uses a VBScript evaluator to block routes and other network analyses from crossing bridges.
Below is a screen capture of a similar script written in Python. Note that a function is defined in Pre-Logic Script Code, and it starts with the def keyword. The function is called from Value =.
-
Follow these substeps to assign a function evaluator to a source, or skip to the next step for directions regarding another evaluator:
- Under the Type column, click the source row and click Function.
-
Click the Evaluator Properties button
.
- On the Function Evaluators dialog box, enter a function.
- Click OK.
In this example, a restriction attribute (HeightRestriction) references a descriptor attribute (MaxHeight) and a parameter (Vehicle Height) to prohibit roads that have a minimum clearance that is lower than a vehicle's height.
- To assign a global turn delay evaluator, see the following topic: Establishing global turns.
- To assign an edge traffic evaluator, see the following topic: What is traffic data?
Edge traffic evaluators are created automatically after you set up the properties for traffic on the network dataset.
-
Click OK.
The Network Dataset Properties dialog box closes.
- In the Catalog window, right-click the network dataset and click Build.
After setting up the evaluators for your network attribute, you can close the remaining dialog boxes and build the network if necessary.
![Note Note](rsrc/note.png)
It is only necessary to rebuild network datasets if the changes you make require the network dataset to access its source feature classes. For instance, creating a field evaluator that pulls time costs from a source feature class requires the network to be rebuilt. Changing the geometry of source features requires the network dataset to be rebuilt. However, the network doesn't need to be rebuilt when a function, script, or global turn delay evaluator is created since these evaluators don't draw information directly from the source feature classes.