> For the complete documentation index, see [llms.txt](https://docs.buildings.ability.abb/collection/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.buildings.ability.abb/collection/mandatory-base/platform-core/connect-hub/device-simulator/simulation-algorithms.md).

# Simulation Algorithms

Select an **Algorithm** when [creating or editing a simulation](https://docs.buildings.ability.abb/collection/mandatory-base/platform-core/connect-hub/device-simulator/create-edit-simulation.md). To change one already configured, open the asset's [simulation detail page](https://docs.buildings.ability.abb/collection/mandatory-base/platform-core/connect-hub/device-simulator/asset-simulation-details.md) and use the attribute's edit action.

Each algorithm produces one numeric value per sample. Choose the pattern that matches the behavior you want to test, then configure its parameters for the target attribute's unit and expected range.

## Choose an Algorithm

<table data-search="false"><thead><tr><th width="142.199951171875">Algorithm</th><th>Typical Use</th></tr></thead><tbody><tr><td><a href="#building-load">Building Load</a></td><td>Office-building consumption with weekday, weekend, and seasonal patterns.</td></tr><tr><td><a href="#random">Random</a></td><td>Independent values across a range.</td></tr><tr><td><a href="#random-walk">Random Walk</a></td><td>Gradual, unpredictable changes from the previous value.</td></tr><tr><td><a href="#constant">Constant</a></td><td>A stable reference value.</td></tr><tr><td><a href="#sine-wave">Sine Wave</a></td><td>Smooth, repeating rises and falls.</td></tr><tr><td><a href="#sawtooth-wave">Sawtooth Wave</a></td><td>A linear rise followed by an abrupt reset.</td></tr><tr><td><a href="#triangle-wave">Triangle Wave</a></td><td>A linear rise and fall.</td></tr><tr><td><a href="#square-wave">Square Wave</a></td><td>Repeated switching between two levels.</td></tr><tr><td><a href="#ramp">Ramp</a></td><td>A slowly increasing cumulative value with a fixed ten-year rise.</td></tr><tr><td><a href="#mapped-state">Mapped State</a></td><td>Changes between the attribute's configured numeric states.</td></tr></tbody></table>

## Timing and Output Rules

* **Interval** controls how often a sample is generated. Enter a positive amount and select **Seconds**, **Minutes**, **Hours**, or **Days**. The simulator checks for due samples once per second; intervals below one second do not produce subsecond data.
* **Cycle duration** controls the period of a waveform or the time-slot structure of **Mapped State**. It does not control how often values are written.
* For waveforms, use a **Cycle duration** of at least twice the **Interval**. Use substantially more than two samples per cycle to show the shape clearly. For example, an interval of 15 minutes and a cycle of 6 hours provide 24 samples per cycle.
* **Min value** must not exceed **Max value**. Numeric algorithms with these fields clamp the generated value to those bounds before optional integer rounding.
* **Noise** is an absolute deviation in the attribute's value units, not a percentage of the configured range. It adds a random value between `-Noise` and `+Noise` per sample, then clamps the result. Its allowed range is `0` to `1`; `0` adds no noise.
* **Integer** rounds each emitted value to the nearest integer. With fractional bounds, the rounded result can be outside those exact fractional bounds; choose integer bounds when strict integer limits matter.
* Waveforms use elapsed time from the simulation's timing origin. Pausing and activating do not reset that origin; saving edited or copied settings does.

New configurations use suggested starting values. Check them before saving; editing a simulation does not mean its existing settings match these defaults.

<table data-search="false"><thead><tr><th width="251">Parameter</th><th>Suggested Starting Value</th></tr></thead><tbody><tr><td><strong>Interval</strong></td><td>15 minutes</td></tr><tr><td><strong>Min value</strong> / <strong>Max value</strong></td><td><code>0</code> / <code>100</code></td></tr><tr><td><strong>Integer</strong></td><td>Off</td></tr><tr><td><strong>Noise</strong></td><td><code>0</code></td></tr><tr><td><strong>Step size</strong></td><td><code>1</code></td></tr><tr><td><strong>Constant value</strong></td><td><code>50</code></td></tr><tr><td><strong>Cycle duration</strong>, waveforms</td><td>6 hours</td></tr><tr><td><strong>Cycle duration</strong>, Mapped State</td><td>1 hour</td></tr></tbody></table>

## About the Examples

The charts below are illustrative data generated from the backend's algorithm formulas, not screenshots of recorded asset data. Random examples use a fixed seed so that the illustrations remain reproducible. Values use generic units; the algorithm itself does not convert units.

Unless stated otherwise, the charts show 24 hours at a 15-minute interval, **Min value** `0`, **Max value** `100`, **Noise** `0`, and **Integer** off. Waveforms use a 6-hour cycle. The Ramp example deliberately uses a much longer time axis to make its slow increase visible.

## Building Load

**Building Load** models consumption using the simulator host's local date and time. On weekdays, demand rises into office hours, peaks around the morning arrival time, dips around lunch, and falls in the evening. Weekends have a lower, broader daytime pattern. An annual factor raises demand in winter and summer relative to spring and autumn.

The calendar pattern is fixed; you scale its output using the value bounds.

<table><thead><tr><th width="155.800048828125">Parameter</th><th>Meaning for Building Load</th></tr></thead><tbody><tr><td><strong>Interval</strong></td><td>Time between generated consumption samples.</td></tr><tr><td><strong>Min value</strong></td><td>Lower bound used to scale the calendar-based load pattern. It is not a guaranteed nightly value.</td></tr><tr><td><strong>Max value</strong></td><td>Upper bound used to scale the pattern. A peak need not reach it.</td></tr><tr><td><strong>Integer</strong></td><td>Rounds the resulting consumption value.</td></tr><tr><td><strong>Noise</strong></td><td>Adds up to this absolute random deviation to each sample.</td></tr></tbody></table>

<figure><img src="https://2013058394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOqGnkz52o2zVUsEGEZGk%2Fuploads%2Fgit-blob-d089d2dbe02f78ab68e67cb3eeab8863f63c32ab%2Fdevice-simulator-building-load-example.svg?alt=media" alt="Building Load over a January week, showing weekday office-hour peaks and much lower weekend values."><figcaption><p>Example: 12-18 January 2026, sampled every 15 minutes, with bounds 0-100 and no noise.</p></figcaption></figure>

## Random

**Random** chooses a new value independently and uniformly between the bounds at each sample. Adjacent values may differ substantially.

<table><thead><tr><th width="218.199951171875">Parameter</th><th>Meaning for Random</th></tr></thead><tbody><tr><td><strong>Interval</strong></td><td>Time between independent random samples.</td></tr><tr><td><strong>Min value</strong> / <strong>Max value</strong></td><td>Bounds of the random selection and final clamped output.</td></tr><tr><td><strong>Integer</strong></td><td>Rounds the selected value.</td></tr><tr><td><strong>Noise</strong></td><td>Adds a further bounded random deviation before clamping. Usually unnecessary for an already random pattern.</td></tr></tbody></table>

<figure><img src="https://2013058394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOqGnkz52o2zVUsEGEZGk%2Fuploads%2Fgit-blob-6835307e075073ef69d59936f0c507c9711e99fb%2Fdevice-simulator-random-example.svg?alt=media" alt="Independent random values varying across the full 0-100 range over 24 hours."><figcaption><p>Example: independent values between 0 and 100.</p></figcaption></figure>

## Random Walk

**Random Walk** changes its previous value by a random amount between negative and positive **Step size**, then clamps the result to the bounds. It starts from the attribute's current numeric value when available, or from the midpoint of the bounds otherwise.

<table><thead><tr><th width="215.7999267578125">Parameter</th><th>Meaning for Random Walk</th></tr></thead><tbody><tr><td><strong>Interval</strong></td><td>Time between successive changes. A shorter interval produces more changes over the same elapsed time.</td></tr><tr><td><strong>Min value</strong> / <strong>Max value</strong></td><td>Bounds that limit the evolving value.</td></tr><tr><td><strong>Step size</strong></td><td>Maximum absolute change in the internal value per sample; must be nonnegative. <code>0</code> leaves it unchanged.</td></tr><tr><td><strong>Integer</strong></td><td>Rounds the emitted value; the internal walk retains its unrounded value.</td></tr></tbody></table>

There is no separate **Noise** field. **Step size** controls the random movement.

<figure><img src="https://2013058394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOqGnkz52o2zVUsEGEZGk%2Fuploads%2Fgit-blob-be69a47e33de3d7b89182800a3ce37a06e8da6c0%2Fdevice-simulator-random-walk-example.svg?alt=media" alt="Random Walk starting around 50 and moving gradually with a maximum step of 5 within bounds 0-100."><figcaption><p>Example: no initial numeric value, bounds 0-100, and Step size 5.</p></figcaption></figure>

## Constant

**Constant** emits the same configured value at every interval.

<table><thead><tr><th width="154.2000732421875">Parameter</th><th>Meaning for Constant</th></tr></thead><tbody><tr><td><strong>Interval</strong></td><td>Time between repeated writes of the same value.</td></tr><tr><td><strong>Constant value</strong></td><td>Numeric value to emit.</td></tr><tr><td><strong>Integer</strong></td><td>Rounds the configured value before emitting it.</td></tr></tbody></table>

This algorithm has no **Min value**, **Max value**, **Cycle duration**, or **Noise** fields.

<figure><img src="https://2013058394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOqGnkz52o2zVUsEGEZGk%2Fuploads%2Fgit-blob-9d9bcb477abcd678c518383755739330b8804654%2Fdevice-simulator-constant-example.svg?alt=media" alt="Constant value of 50 throughout a 24-hour period."><figcaption><p>Example: Constant value 50.</p></figcaption></figure>

## Sine Wave

**Sine Wave** oscillates smoothly around the midpoint between **Min value** and **Max value**. At its timing origin, it starts at the midpoint and rises. One cycle passes through the maximum, midpoint, minimum, and back to the midpoint.

<table><thead><tr><th width="208.5999755859375">Parameter</th><th>Meaning for Sine Wave</th></tr></thead><tbody><tr><td><strong>Interval</strong></td><td>Time between samples of the continuous waveform.</td></tr><tr><td><strong>Min value</strong> / <strong>Max value</strong></td><td>Lower and upper extremes of the waveform before noise and rounding.</td></tr><tr><td><strong>Cycle duration</strong></td><td>Time for one complete oscillation.</td></tr><tr><td><strong>Integer</strong></td><td>Rounds each sampled value.</td></tr><tr><td><strong>Noise</strong></td><td>Adds random deviation to the sampled waveform.</td></tr></tbody></table>

<figure><img src="https://2013058394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOqGnkz52o2zVUsEGEZGk%2Fuploads%2Fgit-blob-a8f694deb84c632859c2870504c7be8857ac3b4c%2Fdevice-simulator-sine-wave-example.svg?alt=media" alt="Four smooth sine-wave cycles between 0 and 100 over 24 hours."><figcaption><p>Example: a 6-hour cycle sampled every 15 minutes.</p></figcaption></figure>

## Sawtooth Wave

**Sawtooth Wave** rises linearly from **Min value** toward **Max value**, then jumps back to **Min value** at the start of each new cycle. Depending on the interval, the last sample before the reset may not reach the maximum.

<table><thead><tr><th width="203">Parameter</th><th>Meaning for Sawtooth Wave</th></tr></thead><tbody><tr><td><strong>Interval</strong></td><td>Time between samples of the rising slope.</td></tr><tr><td><strong>Min value</strong> / <strong>Max value</strong></td><td>Start of each rise and upper limit approached before resetting.</td></tr><tr><td><strong>Cycle duration</strong></td><td>Time for one rise and reset.</td></tr><tr><td><strong>Integer</strong></td><td>Rounds each sampled value.</td></tr><tr><td><strong>Noise</strong></td><td>Adds random deviation before clamping.</td></tr></tbody></table>

<figure><img src="https://2013058394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOqGnkz52o2zVUsEGEZGk%2Fuploads%2Fgit-blob-0d2d79c1fb232153b4f43a7077d20607d3c31611%2Fdevice-simulator-sawtooth-wave-example.svg?alt=media" alt="Four linear rises toward 100, each followed by a sudden reset to 0."><figcaption><p>Example: a 6-hour cycle sampled every 15 minutes.</p></figcaption></figure>

## Triangle Wave

**Triangle Wave** rises linearly from **Min value** to **Max value** during the first half of a cycle, then falls linearly to **Min value** during the second half.

<table><thead><tr><th width="212.60009765625">Parameter</th><th>Meaning for Triangle Wave</th></tr></thead><tbody><tr><td><strong>Interval</strong></td><td>Time between samples of the slopes.</td></tr><tr><td><strong>Min value</strong> / <strong>Max value</strong></td><td>Lower and upper turning points.</td></tr><tr><td><strong>Cycle duration</strong></td><td>Combined duration of the rise and fall.</td></tr><tr><td><strong>Integer</strong></td><td>Rounds each sampled value.</td></tr><tr><td><strong>Noise</strong></td><td>Adds random deviation before clamping.</td></tr></tbody></table>

<figure><img src="https://2013058394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOqGnkz52o2zVUsEGEZGk%2Fuploads%2Fgit-blob-1accca4ab3f1af76b599e2793756ee2b97848597%2Fdevice-simulator-triangle-wave-example.svg?alt=media" alt="Four triangle-wave cycles with equal linear rises and falls between 0 and 100."><figcaption><p>Example: a 6-hour cycle sampled every 15 minutes.</p></figcaption></figure>

## Square Wave

**Square Wave** emits **Max value** during the first half of each cycle and **Min value** during the second half. The transitions are abrupt.

<table><thead><tr><th width="232.5999755859375">Parameter</th><th>Meaning for Square Wave</th></tr></thead><tbody><tr><td><strong>Interval</strong></td><td>Time between samples of the current level.</td></tr><tr><td><strong>Min value</strong> / <strong>Max value</strong></td><td>The two output levels.</td></tr><tr><td><strong>Cycle duration</strong></td><td>Time for one high phase and one low phase. Each lasts half a cycle.</td></tr><tr><td><strong>Integer</strong></td><td>Rounds the selected level.</td></tr><tr><td><strong>Noise</strong></td><td>Adds deviation around each level, then clamps it to the bounds.</td></tr></tbody></table>

<figure><img src="https://2013058394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOqGnkz52o2zVUsEGEZGk%2Fuploads%2Fgit-blob-5fb9af28b12141738962ac2dd6a99437ee024de6%2Fdevice-simulator-square-wave-example.svg?alt=media" alt="Square Wave alternating between 100 and 0, with each level lasting three hours."><figcaption><p>Example: a 6-hour cycle, with 3 hours at each level.</p></figcaption></figure>

## Ramp

**Ramp** models a slowly increasing cumulative value. It continues from the attribute's current numeric value when available, or starts at **Min value** otherwise. Each sample increases its internal value by the fraction of the full range corresponding to the sampling interval over ten years.

The rise duration is fixed at ten 365-day years; there is no configurable **Cycle duration**. When the internal value reaches **Max value**, the next sample restarts at **Min value**. If both bounds are equal, it stays at that value.

<table><thead><tr><th width="228.5999755859375">Parameter</th><th>Meaning for Ramp</th></tr></thead><tbody><tr><td><strong>Interval</strong></td><td>Time between samples and the basis for the incremental increase. Intervals below one second use one second for this calculation.</td></tr><tr><td><strong>Min value</strong> / <strong>Max value</strong></td><td>Starting lower bound and upper reset threshold. Starting from an existing value shortens the time remaining before a reset.</td></tr><tr><td><strong>Integer</strong></td><td>Rounds emitted values. Small changes may not be visible in every sample.</td></tr><tr><td><strong>Noise</strong></td><td>Adds deviation to the emitted value without changing the internal cumulative progression.</td></tr></tbody></table>

<figure><img src="https://2013058394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOqGnkz52o2zVUsEGEZGk%2Fuploads%2Fgit-blob-0dc869e4d3f239640658a251b1815d72b9977f74%2Fdevice-simulator-ramp-example.svg?alt=media" alt="Ramp slowly increasing from 0 to 100 over ten years, resetting, and rising again."><figcaption><p>Example: bounds 0-100, no initial numeric value, and a 1-day interval. The 12-year axis makes the fixed ten-year rise visible.</p></figcaption></figure>

{% hint style="info" %}
With bounds 0-100, a Ramp changes by only about 0.0274 per day before noise and rounding. A 24-hour preview can look almost flat. Do not use Ramp when you need a rapidly changing sawtooth pattern.
{% endhint %}

## Mapped State

**Mapped State** emits numeric values from the target attribute's configured mapping. It divides **Cycle duration** into one time slot per mapped value and randomly selects a state for each new slot. If more than one mapped state is available, the next selected state differs from the previous one. The order is not a fixed traversal of the mapping.

If the attribute has no mapping, the algorithm uses `0` and `1`. Values are emitted exactly, with no noise, clamping, or integer rounding.

<table><thead><tr><th width="173.4000244140625">Parameter</th><th>Meaning for Mapped State</th></tr></thead><tbody><tr><td><strong>Interval</strong></td><td>Time between samples. Several samples can repeat the state selected for the current slot.</td></tr><tr><td><strong>Cycle duration</strong></td><td>Duration used to calculate slot length: cycle duration divided by the number of mapped values. For four values and a 1-hour cycle, each slot lasts 15 minutes.</td></tr></tbody></table>

Use an interval no longer than the slot length if you want to observe each slot. Longer intervals can skip state changes. Copying this algorithm to another attribute copies the timing parameters, not the source attribute's mapping.

<figure><img src="https://2013058394-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOqGnkz52o2zVUsEGEZGk%2Fuploads%2Fgit-blob-1a44cd475eee3ddfce961d5b31ae629ecd2cd62b%2Fdevice-simulator-mapped-state-example.svg?alt=media" alt="Mapped State selecting among values 0, 1, 2, and 3 in 15-minute slots over six hours."><figcaption><p>Example: mapped values 0, 1, 2, and 3; a 1-hour cycle; and a 5-minute sampling interval.</p></figcaption></figure>

## Next Steps

* [Create or edit a simulation with these parameters](https://docs.buildings.ability.abb/collection/mandatory-base/platform-core/connect-hub/device-simulator/create-edit-simulation.md).
* [Monitor the resulting data and manage simulation states](https://docs.buildings.ability.abb/collection/mandatory-base/platform-core/connect-hub/device-simulator/asset-simulation-details.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.buildings.ability.abb/collection/mandatory-base/platform-core/connect-hub/device-simulator/simulation-algorithms.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
