---
description: >-
  Simulations are configured through a series of YAML files and uploaded to the
  Lexset servers for processing.
---

# Simulation Structure

This tutorial will explain the structure of these configuration files and how to edit them.

## Anatomy of a simulation

Simulations are composed of both "pipeline configs" and "placement rules."

* **Pipeline configs** are composed of key/value pairs that coordinate various aspects of running a simulation. Modules include the version of Lexset's software you are using, global variables _(to be shared across the application)_, dependencies, and more. Modules contain all the necessary instructions to run your simulation. Including loading 3D assets, manipulating cameras, and exporting data.
* **Placement rules** govern how objects relate spatially. For example, placement rules might describe how the television is mounted on a wall or the probability that a nightstand might be next to the bed in a bedroom.

![Pipeline config architecture](https://1909422608-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M_d2v35elOCGVpgHu35%2F-M_kk2WtJkGVBl3E8giv%2F-M_l0g-k-g2UDfpu7Ujt%2FConfigs.png?alt=media\&token=c85774ad-d080-472e-9fc6-f81f06c7608b)

### **What is a Module?**

A Module serves to execute a single step in the render pipeline, whether it be populating the scene with objects ([loader](https://github.com/1140lex/Seahaven3.0/blob/develop/MODULES.MD#loader)), manipulating camera positions ([camera](https://github.com/1140lex/Seahaven3.0/blob/develop/MODULES.MD#camera)), or outputting files of various formats ([writer](https://github.com/1140lex/Seahaven3.0/blob/develop/MODULES.MD#writer)).

## Pipeline Config Architecture&#x20;

&#x20;Every config contains four key/value pairs, namely `"version"`, `"global"`, `"setup"` and `"modules"`.

```yaml
{
  "version": 3, # Most recent Lexset configuration version
  "global":
    {
      "use_single_uuid": True,
      "all":
        {
          "temp_dir": "/seahaven_temp",
          "assets_folder": "/general/lexset/seahaven3.0/assets",
          "output_dir": "",
        },
    },
  "modules": [
  # This is where you will create your simulation
  # You will add and edit modules here. 
  ]
}
```

* **`"version"`:** Indicates the version of the Lexset configuration being used. The most recent version is `3`. This should not be changed.
* **`"global"`:** Provides the ability to set param values across all modules in the pipeline. Within the parameter `"all"`, global parameters are set by using the param name as its key and the param value as its value. This can be an empty dict if desired.
* **`"modules"`:** A list of Modules to be used in the pipeline. Each module is formatted as follows:

```yaml
{
  "module": "name.OfModule",
  "config": {
    "module_param1": "param1_val",
    "module_param2": "param2_val",
    "module_param3": "param3_val"
  }
}
```
