Use parameters with network attributes

Network attribute values sometimes depend on variable conditions. For example, a vehicle's height can determine whether a road segment with a low overpass is traversable. Current weather conditions may scale down travel speeds and affect network time costs. You can model restrictions based on vehicle height, travel costs based on scale factors, and other variable aspects of network analysis with one of two approaches. One approach is to create a network attribute for every variation in height or weather condition; however, this approach is unwieldy as the number of permutations grows. A more versatile approach is to use a single network attribute with a parameter that contains the variable aspect of the attribute.

Parameters are placeholders for values that you can change for a particular analysis. They each have a meaningful default value that is overridden by the user when needed. You can add parameters to network attributes and reference them by the attribute's evaluators. You can change the parameter values when setting up network problems so that the values of the network attribute can be determined at run time using the expression and the current parameter value.

Parameterized network attributes

A parameterized network attribute has one or more assigned evaluators that uses a parameter on the network attribute as well as another network attribute to help determine its value.

Some evaluator assignment values are cached when the network is built (for example, Field Script) and do not use parameters. However, evaluators that are queried at run time to determine their value (for example, Function and Element Script) can use parameters to affect the result value.

Parameters for modeling vehicle characteristics

In the following example, you can add parameters for setting vehicle characteristics to refine which network elements a given vehicle can traverse.

You can add a restriction attribute along with a vehicle height parameter to compare the height of a vehicle with a descriptor attribute that holds the clearance under overpasses or through tunnels. If the vehicle height is greater than the clearance, the edge is prohibited. This can result in different routes for different vehicles. As shown below, a short vehicle might follow a direct route under a low bridge, whereas a tall vehicle would take a different route that avoids the low clearance.

Example of a truck routing around a bridge with a low clearance

In such a scenario, you might create two attributes: a descriptor attribute and a restriction attribute, naming them MaxHeight and HeightRestriction, respectively. MaxHeight uses clearance values from the source data, and HeightRestriction reads the values from MaxHeight and compares them with a parameter containing the current vehicle height. The following diagram shows a generalized version of this process:

Finding values for a parameterized restriction attribute

Parameters for cost attributes

You may instead want a parameterized cost attribute that can reference another cost attribute and scale it. This is useful when inclement weather, such as ice, fog, or heavy rain, descends on a study area and affects the normal flow of traffic. By having a parameter prepared for a cost attribute, you can adjust travel time expectations to correspond with changes in traffic speeds.

You can create two network attributes: DriveTime, to store the normal drive-time impedances with values coming from fields in the source data, and DriveTime_scaled, to take the DriveTime attribute value and scale it by a parameter for the DriveTime_scaled attribute that holds the current scale factor.

Create a parameter

A new parameter can be added to a cost or restriction attribute from their respective Costs or Restrictions tab. Follow the steps below to create a parameter.

  1. Access network attributes on the Network Dataset Properties dialog box.
  2. To create a parameter for a cost attribute, go to the Costs tab and from the list of available cost attributes, select the one to use to create a parameter.
  3. To create a parameter for a restriction attribute, go to the Restrictions tab and from the list of available restriction attributes, select the one to use to create a parameter.
  4. Expand the Parameters section to enter the parameter properties.
  5. Click the blank row to add a new parameter.
  6. Click any cell twice to enable editing.
  7. Provide a name in the Name cell.
  8. Choose a type from the Type drop-down list.
  9. Provide a default value in the Default Value cell.
  10. Click the Travel Modes tab.
  11. If you added a parameter to the cost attribute, go to the Costs section, select the cost attribute, and click the cost attribute under the Cost Parameters section.

    A grid appears with the parameter that was created in the previous steps.

  12. If you added a parameter to the restriction attribute, go to the Restrictions section and select the restriction attribute.

    A grid appears with the parameter that was created for the selected restriction attribute.

  13. Click OK to save the parameter to the network dataset.

Edit a parameter

Follow the steps below to edit a parameter associated with a cost or a restriction attribute.

  1. Access network attributes on the Network Dataset Properties dialog box.
  2. To edit a cost attribute parameter, click the Costs tab and from the list of available cost attributes, select the one with the parameter you want to edit.
  3. To edit a restriction attribute parameter, click the Restrictions tab and from the list of available restriction attributes, select the one with the parameter you want to edit.
  4. Expand the Parameters section and edit the Name, Type, and Default Value properties as necessary.
  5. Click the Travel Modes tab.
  6. If you edited a cost attribute parameter, go to the Costs section and select the cost attribute.

    The properties of the cost attribute parameter are now updated under Cost Parameters.

  7. If you edited a restriction attribute parameter, go to the Restrictions section and select the restriction attribute.

    A grid appears where the properties of the restriction attribute parameter are now updated.

  8. Note:
    If you change the value of the cost or restriction attribute parameter on the Travel Modes tab, the new value appears in bold, and if you hover over the bold text, a pop-up appears indicating the current and default value of the parameter. This also indicates that the edited value is only used for the current travel mode and the default value of the parameter remains unchanged.

    Edited parameter values for cost and restriction attributes

Delete a parameter

Follow the steps below to delete a parameter associated with a cost or restriction attribute.

  1. Access network attributes on the Network Dataset Properties dialog box.
  2. To delete a parameter for a cost attribute, click theCosts tab and from the list of available cost attributes, select the one with the parameter you want to delete.
  3. To delete a parameter for a restriction attribute, click the Restrictions tab and from the list of available restriction attributes, select the one with the parameter you want to delete.
  4. Expand the Parameters section if necessary.
  5. Click the delete button Delete Selected Item(s) for the parameter you want to delete.

    The parameter is deleted from the list.

  6. Click the Travel Modes tab.
  7. If you deleted a cost attribute parameter, go to the Costs section and select the cost attribute that had the parameter you deleted.

    The parameter associated with the selected cost attribute no longer appears under Cost Parameters.

  8. Note:
    The Cost Parameters section is not available if the deleted parameter was the only parameter associated with the selected cost attribute.
  9. If you deleted a restriction attribute parameter, go to the Restrictions section and select the restriction attribute that had the parameter you deleted.

    A grid appears where the restriction attribute parameter was deleted.