# Configuration

> Define the dimensions and units of the model.

Page: https://docs.icepack.ai/nvd/configuration/

## Overview

The configuration for a Nominated Visit Day (NVD) model is designed to encapsulate the high-level features that are present in periodic NVD problems. Since NVDs are normally specified for sales-representatives (often simply called sales-reps) concepts such as vehicle capacities (like in the IVR model) aren't typically used in this context. What is important is visit **frequency** and ensuring that repeated [visits](/nvd/visit/) to certain customers keep to a certain visit [profile](/nvd/profile/). The high level concepts being modelled are distance, time, the period and the week length.

### Applicable models

* NVD `nvd-hap0j2y4zlm1`

## Configuration

The configuration object provides a mechanism to specify the shape of the NVD model being solved. 

### Schema definition

```protobuf
message Configuration {
  required eMeasurementUnit timeUnit = 1 [default = MINUTES];
  required float timeCoef = 2 [default = 1.0];
  required float timeCostCoef = 3 [default = 1.0];
  required eMeasurementUnit distanceUnit = 4 [default = KILOMETRES];
  required float distanceCostCoef = 5 [default = 1.0];
  required float intraTerritoryBalance = 4 [default = 1.0];  
  required float interTerritoryBalance = 5 [default = 1.0];  
  required int32 weekLength = 6;
  required int32 periodLength = 7;
}
```



### Fields

timeUnit
: The units in which the time dimension is being populated. This should be consistent with other quantities or windows specified in the model (such as visit times or windows).

timeCoef
: The coefficient (or multiplier) that should be applied to the time [dimension](/ivr/dimension/). A value of 1.0 will use road network time quantities "as is". A coefficient greater than 1.0 will increase the transit quantities proportionately between different [visit](/nvd/visit/) locations, and a value less than 1.0 will similarly decrease the transit times between different locations. Valid coefficient values should be greater than or equal to zero.

timeCostCoef
: The monetary unit of cost per unit of time (i.e. cost per minute). A value of 1.0 indicates a cost of one unit per unit (specified in `timeUnit`) of time.

distanceUnit
: The units in which the distance dimension is being measured.

distanceCostCoef
: The monetary unit of cost per unit of distance (i.e. cost per km/mile).

intraTerritoryBalance
: The emphasis that should be placed on the balance **within** a territory (i.e. across days for a particular sales-rep).

interTerritoryBalance
: The emphasis that should be placed on the balance **between** territories (i.e. between sales-reps).

weekLength
: The length of the workweek. This is typically 5, 6 or 7. The available working hours per day are provided on a per-territory basis.

periodLength
: The total number of days over which we are planning. Must be a value which is a multiple of the week length. Typical examples are a week length of 5 which may correspond to a period length of 5 (to plan a representative weekly cycle), 10 for a two-weekly cycle or 20 for a monthly cycle. A longer week length, such as 6 days, would correspond to period lengths of 6, 12 and 24 for weekly, bi-weekly or monthly cycle planning.

### Examples

This example illustrates a configuration for a monthly call-cycle for a rep who works from Monday to Friday (week length of 5). The period length is 20 days which corresponds to 4 weeks. The cost per minute is 0.1 monetary units and the cost per km is 1 monetary unit. This will constitute the main cost equation for the optimiser from a routing-perspective. The intra and inter-territory balance are both set to 1 which indicates that the user preference is indifference between these measurements but that the territories should, non the less, be balanced. 

```protobuf
timeUnit: MINUTES
timeCoef: 0.1
timeCostCoef: 0
distanceUnit: KILOMETRES
distanceCostCoef: 1
intraTerritoryBalance: 1
interTerritoryBalance: 1
weekLength: 5
periodLength: 20
```



<hr>

## Configuration.eMeasurementUnit

Defines a measurement unit used in a configuration definition.

### Schema definition

```protobuf
enum eMeasurementUnit {
  SECONDS = 0;     // time
  MINUTES = 1;     // time
  HOURS = 2;       // time
  DAYS = 3;        // time
  KILOMETRES = 4;  // distance
  MILES = 5;       // distance
}
```



### Notes

* A time measurement unit may only be used with a time configuration. Similarly for the distance measurement units. A mismatch of units will result in an error condition being returned by the API.

