# pallet_patterns

Pallet patterns: the pallet, the item, layer layouts and how they stack, and the limits that close a pallet; named by a carrier BATCH's `pattern`.

In the model file this key holds a list of `pallet_pattern` entries, each named by its `name`.

## Typical uses

These sections describe things that move and the floor they move on. `network` is a path network of nodes and segments. `fleets` are pools of vehicles or workers that carry entities on it. `chargers` recharge batteries. `motion_profiles` and `zones` describe robots and their safety areas. Use them when distances and travel times matter.

## Behaviour and rules

Travel time is exact geometry: the shortest path on the network divided by the speed. A segment can limit the speed. The `length_factor` scales straight-line distances for a segment with no length of its own. A node is named by a STATION through its `node`.

A fleet is a resource under its own name. A TRANSPORT block requests one of its vehicles, which drives empty to the entity, loads, drives loaded to the destination and unloads. `dispatch` decides whose request is served when a vehicle frees, and `select` decides which idle vehicle serves it. With `park` set to `home`, an idle vehicle drives back to its `home` node.

A fleet with `kind` set to `worker` supplies people to PROCESS and SEIZE blocks through `worker_fleet`. A fleet with a `battery` drains it at its power draw and recharges at a charger when its job is done. A fleet with `motion` set to `gantry` ignores the network. A motion profile gives a robot its speed, acceleration, payload derating and a collaborative speed. A zone slows a robot to that speed when a worker is inside.

## Fields

| Field | Type | Required | Default | Unit | Description |
|---|---|---|---|---|---|
| `name` | string | yes |  |  | The pattern's name, the `pattern` of a carrier BATCH. |
| `description` | string |  |  |  | What the pattern is; the run does not read it. |
| `pallet` | object | yes |  |  | The pallet's footprint, deck height and tare. |
| `item` | object | yes |  |  | The nominal item, used by the checks and the generator. |
| `overhang` | number or null |  | `0.0` | length | How far an item may pass the pallet's edge. |
| `layers` | object | yes |  |  | Layer layouts by name, each a list of slots in load order. |
| `stack` | list of object | yes |  |  | The layers from the deck up, repeated until a limit is reached. |
| `sheet` | object or null |  |  |  | A sheet between layers: its thickness and the time to place it (in the model's time unit), added before each layer after the first. |
| `limits` | object | yes |  |  | The first reached closes the pallet; null = no limit. One of layers, items or height must be set. |

A field of a nested object is described in the JSON Schema (`naga schema`).

## Example

```json
{"pallet_patterns": [{"name": "Euro", "pallet": {"length": 1.2, "width": 0.8, "deck_height": 0.144}, "item": {"length": 0.4, "width": 0.3, "height": 0.25}, "layers": {"A": [{"x": -0.2, "y": 0}, {"x": 0.2, "y": 0}]}, "stack": [{"layer": "A"}, {"layer": "A", "transform": "rotate180"}], "limits": {"layers": 4}}]}
```

In the Python builder:

```python
from nagasim import build as nb
m = nb.Model()
m.add_pallet_pattern(name='Euro', pallet={'length': 1.2, 'width': 0.8, 'deck_height': 0.144}, item={'length': 0.4, 'width': 0.3, 'height': 0.25}, layers={'A': [{'x': -0.2, 'y': 0}, {'x': 0.2, 'y': 0}]}, stack=[{'layer': 'A'}, {'layer': 'A', 'transform': 'rotate180'}], limits={'layers': 4})
```

## Used in

Bundled models: [Palletizing line](../../gallery/manufacturing.md).

## See also

- [All sections](index.md), [Model file keys](../schema.md), [Model file format](../../model-file-format.md)
