... | ... | @@ -171,14 +171,25 @@ In line with the I3D 2020 publication, a policy has two main ingredients: |
|
|
|
|
|
In XML, cost functions are specified as child elements, and the optimization method is specified via attributes.
|
|
|
|
|
|
A `Policy` element has the following attributes:
|
|
|
A `Policy` element has the following **main attributes**:
|
|
|
|
|
|
| Attribute name | Mandatory? | Type, constraints | Description | Default value |
|
|
|
| ------ | ------ | ------ | ------ | ------ |
|
|
|
| `id` | Yes | integer, >= 0 | A unique ID for this policy. | *none* |
|
|
|
| `OptimizationMethod` | Yes | enum (`gradient`,`sampling`,`global`) | The optimization method that this policy should use. `gradient` means that the agent will follow the gradient of its cost functions. `sampling` means that the agent will sample several candidate velocities and choose the one with the lowest cost. `global` means that the agent will compute a velocity that has the lowest cost overall. (This last option defaults to sampling whenever the true global optimum is not specified.) | *none* |
|
|
|
| `SamplingAngle` | No | float, > 0, <= 360 | ... Only used if `OptimizationMethod="sampling"`. | 180 |
|
|
|
| `SpeedSamples` | No | int, > 0 | ... Only used if `OptimizationMethod="sampling"` *and* `Type="regular"`. | 4 |
|
|
|
| `AngleSamples` | No | int, > 0 | ... Only used if `OptimizationMethod="sampling"` *and* `Type="regular"`. | 11 |
|
|
|
| `IncludeBaseAsSample` | No | Boolean | Whether or not to always include the base velocity as a sample. This also affects the distance between speed samples. Only used if `OptimizationMethod="sampling"` *and* `Type="regular"`. | `false` |
|
|
|
| `OptimizationMethod` | Yes | enum (`gradient`, `sampling`, `global`) | The optimization method that this policy should use. `gradient` means that the agent will follow the gradient of its cost functions. `sampling` means that the agent will sample several candidate velocities and choose the one with the lowest cost. `global` means that the agent will compute a velocity that has the lowest cost overall. (This last option defaults to sampling whenever the true global optimum is not specified.) | *none* |
|
|
|
| `RelaxationTime` | No | float, >= 0 | The relaxation time (in seconds) of agents that use this policy. As explained in the I3D 2020 paper, the relaxation time lets an agent interpolate between its current velocity and the 'optimal' velocity computed by the policy. This only happens if the `OptimizationMethod` is *not* equal to `gradient`. The relaxation time is also used by certain cost functions. | 0 |
|
|
|
| `ContactForceScale` | No | float | A scalar for the effect of contact forces, applied when an agent collides with other agents or obstacles. Use 0 to let an agent ignore contact forces completely. | 5000 |
|
|
|
|
|
|
Furthermore, a `Policy` element has the following **extra attributes** related to sampling:
|
|
|
|
|
|
| Attribute name | Mandatory? | Type, constraints | Description | Default value |
|
|
|
| ------ | ------ | ------ | ------ | ------ |
|
|
|
| `SamplingType` | No | enum (`regular`, `random`) | The type of sampling to use. Only used if `OptimizationMethod="sampling"`. `regular` means that samples will lie at regular intervals of speed and angle. `random` means that samples will be taken randomly in the sampling range. | `regular` |
|
|
|
| `SamplingBase` | No | enum (`zero`, `current velocity`) | **(See the image below)** The velocity that defines the base of the policy's sampling range. Only used if `OptimizationMethod="sampling"`. `zero` means a base of (0,0). `current velocity` means that the base will be made equal to the agent's current velocity. | `zero` |
|
|
|
| `SamplingBaseDirection` | No | enum (`unit`, `current velocity`, `preferred velocity`) | **(See the image below)** The vector that defines the base direction of the policy's sampling range. Only used if `OptimizationMethod="sampling"`. `unit` means a base direction of (1,0). `current velocity` means that the base direction will be made equal to the agent's current velocity. `preferred velocity` means that the base direction will be made equal to the agent's current preferred velocity. | `unit` |
|
|
|
| `SamplingRadius` | No | float, > 0 | **(See the image below)** The radius (in meters per second) of the policy's sampling range, measured from `SamplingBase`. Only used if `OptimizationMethod="sampling"`. |
|
|
|
| `SamplingAngle` | No | float, > 0, <= 360 | **(See the image below)** The angular range (in degrees) in which samples will be taken. This range is centered around `SamplingBaseDirection`. Only used if `OptimizationMethod="sampling"`. | 180 |
|
|
|
| `SpeedSamples` | No | int, > 0 | **(See the image below)** The number of different speeds to use for regular sampling. Only used if `OptimizationMethod="sampling"` *and* `Type="regular"`. | 4 |
|
|
|
| `AngleSamples` | No | int, > 0 | **(See the image below)** The number of different angles to use for regular sampling. Only used if `OptimizationMethod="sampling"` *and* `Type="regular"`. | 11 |
|
|
|
| `IncludeBaseAsSample` | No | Boolean | **(See the image below)** Whether or not to always include the base velocity for regular sampling. This also affects the distance between speed samples. Only used if `OptimizationMethod="sampling"` *and* `Type="regular"`. | `false` |
|
|
|
| `RandomSamples` | No | int, > 0 | The number of random sample velocities to test. Only used if `OptimizationMethod="sampling"` *and* `Type="random"`. | 100 | |