smarts.core.utils.id module

A helper to ensure consistent naming of IDs within SMARTS Platform.

class smarts.core.utils.id.Id(dtype: str, identifier: str)[source]

An id utility.

property dtype

The type of the id.

classmethod new(dtype: str)[source]

Creates a new unique id: E.g. ‘boid’->’boid-93572825’

classmethod parse(id_: str)[source]

Parses the id from a string.

class smarts.core.utils.id.SocialAgentId(dtype: str, identifier: str)[source]
>>> SocialAgentId.new("keep-lane", group="all")
'social-agent-all-keep-lane'
>>> isinstance(SocialAgentId.new("keep-lane"), str)
True
DTYPE = 'social-agent'
classmethod new(name: str, group: str | None = None)[source]

Creates a new unique id: E.g. ‘boid’->’boid-93572825’