Skip to content

Simulation is not deterministic #1237

@ofrisberg

Description

@ofrisberg

The root of all evil is the std-lib "set" type, which is ordered at random (or depending on the memory address of the set items).

This leads to that a sensor with a RandomState that iterates randomly ordered GroundTruthState objects introducing the same sequence of noise, but not to the same sequence of platforms.

The bug is treacherous since the set order may not change between multiple program executions. One solution to fix this is to use ordered_set, but be aware that sorting a list created from a set using hash() will yield the same problem.

Simplest way to recreate this is to use one radar sensor on platform 1 that measure platform 2 and platform 3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions