# Transit Generator

> Custom movement descriptions for a dimension.

Page: https://docs.icepack.ai/ivr/transit-generator/

## Overview

### Applicable models
* IVR7 `ivr7-kt461v8eoaif`
* IVR8 `ivr8-yni1c9k2swof`

<hr>

## Transit Generator
A transit generator is a container to describe a way in which transits between locations should be generated for a given [model](/ivr/model/). 

### Schema definition 
```protobuf
message TransitGenerator {
  required string id = 1;
  optional string requestId = 2;
  optional TransitSet transitSet = 3;
}
```



### Fields

id
: The unique identifier to be used to define this transit generator object. Duplicate id's in a [model](/ivr/model/) will result in an invalid payload.

requestId
: If specified, the transit values will be retrieved from a previously uploaded [transit set](/ivr/transit-set/) using the [ivr-data](/ivr/ivrdata/) end point and data packets. If unspecified, the transit generator is expected to be populated with transit values in the current object. An error will occur if the `requestId` is invalid. Note that the `requestId` is scoped to a particular key and that no data sharing between keys may occur.

transitSet
: A [transit set](/ivr/transit-set/) object. Either the `requestId` or the `transitSet` should be specified. A [transit set](/ivr/transit-set/) defines a collection of transition values between different [locations](/ivr/location/) in a particular [model](/ivr/model/).

### Examples
This example illustrates a custom set of times provided in a transit generator called `custom_times`:
```protobuf
id: "custom_times"
transitSet {
  transits {
    fromId: "A"
    toId: "B"
    value: 26.8884983
  }
  transits {
    fromId: "B"
    toId: "C"
    value: 10.6725588
  }
  transits {
    fromId: "B"
    toId: "A"
    value: 93.9055481
  }
}
```



This example illustrates linking a previously uploaded distance matrix through the [data](/ivr/ivrdata/) end point in a transit generator:
```protobuf
id: "custom_distance"
requestId: "c7f6d157-bf5f-4ccb-af02-4d0573e88ff6"
```



### Note

Having complete control of the transit matrix for a given dimension is nice, but often not required. There are very special modelling situations where this functionality is applicable.

<hr>

