Available with Network Analyst license.
Each attribute defined in the network must have values for each source participating in the network. An evaluator assigns values for the attribute of each source. In the precursors of ArcGIS (ARC/INFO and ArcView GIS), values for attributes were assigned from a field in the shapefile or coverage. In ArcGIS, the field evaluator assigns values to a network attribute from a field of a network source. In addition, ArcGIS offers other types of evaluators that can be used, for instance, constant, field expression, function, and script evaluators.
The evaluators are described below.
The most common way to assign values for a network attribute is by identifying a single field that will be used to evaluate the network attribute when the network dataset is built. For example, a field evaluator can be used in cases where the value describes a measurement, such as the length of each road segment in meters.
Field expression evaluator
The field evaluator can be modified to take a field expression as the value instead of a single field. In this case, you'll build an expression on the Field Evaluator dialog box using VBScript or Python. For example, if the units of the network attribute are in meters but the units of source data are in feet, you can create an expression to convert the feet into meters when the network dataset is built.
Attributes can be assigned a constant value. The value can be numeric (0, 1, 2) for cost, descriptor, and hierarchy attributes, or a Boolean data type of Use Restriction or Ignore Restriction for a restriction attribute.
The function evaluator calculates attribute values by performing a multiplicative or logical function on another attribute value or parameter value. For numeric attribute types, the values are derived from an expression that multiplies the value of another attribute by some value, for example, DriveTime * 1.25. For Boolean attribute types, the values are derived from an expression that compares another attribute value to a parameter value, for example, MaxHeight < VehicleHeight.
Global turn delay evaluator
The global turn delay evaluator assigns a default cost value for transitioning between two edge elements. The cost is based on the deflection angle between the two edges and the road class (primary, secondary, or local) of the edges that are traversed. You specify the road class using the Hierarchy Ranges dialog box along with a hierarchy attribute. For example, you can use the global turn delay evaluator to make all left turns, which are determined by deflection angles, from local roads onto secondary roads take longer than left turns from local roads onto other local roads. You can also specify added costs for other transitions, such as adding 10-second delays when continuing straight at the intersection of two secondary roads.
Attributes can be assigned from the result of executing a VBScript or Python script. This provides a way to model complex attributes. Unlike other evaluators, the script evaluator does not assign values when a network is built. Instead, it assigns values when a particular network analysis requires the use of that attribute, which can occur at solve time. If the values of an attribute change constantly, the use of a script evaluator can ensure attributes are updated for each network analysis.
Edge traffic evaluator
Edge traffic evaluators are designed for traffic data. They can provide travel times for a given time of day and day of the week using historical or live data. They include fallback cost attributes that provide weekday and weekend travel times when specific time-of-day travel times are not available. Edge traffic evaluators also have a time-neutral cost attribute that Network Analyst references when sequencing stops in a route analysis or visits in a vehicle routing problem.
Every junction source and every turn source can have one evaluator. Every edge source can have two—one for each digitized direction of the edge.
A default evaluator can be assigned for edges, junctions, and turns. If an explicit evaluator is not specified for a particular source, the values for that source are assigned by the default evaluator.
The following is the general workflow for assigning an evaluator:
- Select the source for which the evaluator must be assigned.
- Choose an evaluator type, such as Field, Constant, Function, or Script.
- Specify the value to be assigned to the network attribute.
If the values are derived from a field, the field will be selected from a drop-down menu. If the values are to be calculated based on a field expression, set evaluator type as Field and press F12 on your keyboard to bring up the Field Evaluators dialog box. Alternatively, you can right-click the source on the Evaluators dialog box and choose Properties from the Value menu to open the Field Evaluators dialog box.
Assigning values to cost attributes
The DriveTime network attribute in the graphic below uses a field evaluator for the Streets source feature class. This is indicated under the Type column. The Value column shows that the FT_Minutes field supplies the network attribute values for the from-to direction of the Streets source. Similarly, values for the to-from direction of the streets source are drawn from the field TF_Minutes.
In this example, the other edge sources in this network are transit edges and do not have a drive time. Hence, they can be assigned a constant value of -1, or better, a constant value of zero and given restriction attributes that prohibit automobiles and other street vehicles.
Alternatively, cost attributes can be derived from another cost attribute by using the function evaluator. For example, an attribute that models the travel times of slow vehicles can use the function evaluator to reference an attribute that models normal travel times and multiply it by a slowdown factor.
Assigning values to restrictions
Restriction attributes have a Boolean data type. Since a source element can either use or ignore the associated restriction, it can be assigned a constant value of Use Restriction or Ignore Restriction.
Alternatively, restriction attributes can be derived using the function evaluator to compare another attribute to a parameter value. For example, an attribute that models vehicle height restrictions can use the function evaluator to compare the height limit of a road to the vehicle's actual height stored in an attribute parameter. When the expression evaluates to true, the restriction is used on the road; when the expression evaluates to false, the restriction is ignored. The exception to this rule is that anytime either of the operands (MaxHeight or Vehicle Height) have a value of zero, the expression always evaluates to false.
Learn more about using parameters with network attributes
Restriction attributes can also be assigned from a field in the source feature class. For example, you can use a field expression evaluator to generate Boolean results—if the expression is true, the element uses the restriction; if not, the element ignores the restriction.
When a network dataset is created, the ArcGIS Network Analyst extension searches through all sources for commonly used fields, such as Oneway. If it finds a Oneway field in any source, it creates a Oneway network attribute and assigns values for the relevant source based on field expressions.
Below are two screen captures of the VBScript expression for a one-way restriction attribute. There is one evaluator and expression for each digitized direction of the street.
These expressions determine the permitted directions of travel based on the text value in the Oneway field:
- FT or F = Travel is only permitted in the digitized direction of the line feature (the from-to direction).
- TF or T = Travel is only permitted against the digitized direction of the line feature (the to-from direction).
- N = Travel is not permitted in either direction.
- Any other value = Travel is permitted in both directions.
Restriction Usage parameter
A restriction attribute always has an associated parameter named Restriction Usage, which determines whether elements that use the restriction are prohibited, merely avoided, or even preferred. In most cases, you will set Restriction Usage to Prohibited, but there are several cases in which you could choose otherwise.
By assigning hierarchies on your network dataset, you can categorize edges into different hierarchical levels and thus reduce solve times. However, keep in mind that results of hierarchical solves may be less optimal than non-hierarchical solves. It is recommended that you also read About network analysis with hierarchy to gain a better understanding of what hierarchies are and why they might be used.
Hierarchy levels are defined by consecutive integers, starting from one. The lowest integer—that is, one—represents the highest level of the hierarchy. Higher integer values represent lower hierarchy levels. For instance, if you are breaking a network down into three hierarchy levels, you would assign the primary roads a value of 1, secondary roads a value of 2, and tertiary roads a value of 3. The primary roads might include interstate highways while tertiary roads might include residential streets.
Hierarchy in a network dataset is often assigned via a field or field expression evaluator. If the Streets feature class has a road class attribute (Hierarchy) with values 1, 2, and 3—representing interstates, major roads, and minor roads, respectively—the hierarchy attribute can be set by simply using field evaluators.
Typically, three, four, or five levels of hierarchy are assigned to a hierarchy attribute, but you can assign as many as you want, as long as each level is represented by a consecutive integer starting from one. You should avoid assigning too many levels of hierarchy, however, as this could leave some edges disconnected with respect to the rest of the hierarchy, which would cause failures when solving network analysis layers.
If the source feature class has an attribute that categorizes roads into more groups than you want as levels in your hierarchy, you can further categorize the groups using a field expression evaluator so that you achieve the number of hierarchy levels you want. For example, assume a Streets feature class has an integer field named Func_Class that has the following six road classes:
Interstate toll road
Furthermore, assume that you want to group the Func_Class values as shown in the following table so that three hierarchy levels are created.
|Hierarchy level||Func_Class values|
2 (interstate toll roads)
6 (freeway ramps)
3 (state highways)
4 (major roads)
5 (local streets)
To model this scenario, add a script to the field evaluators of the Hierarchy attribute. You can choose between writing one in VBScript or Python script. The example below, which is in VBScript, creates a variable named level and sets it to 3 (the lowest hierarchy level in this example). Next, the following condition is set: if Func_Class is 1, 2, or 6, assign level a value of 1. If Func_Class is 3 or 4, assign level a value of 2. For all other cases, the value remains 3. The Value text box contains level so the hierarchy network attribute evaluates to the value it represents at the end of the script.
This ensures that all elements with Func_Class 1, 2, or 6 are assigned a hierarchy value of 1; all elements with Func_Class 3 or 4 are assigned a hierarchy value of 2; and all others (namely, elements with Func_Class values of 5) are assigned a hierarchy value of 3.