IDs

StockMarketABM.IDs manages monotonically increasing identifiers for orders, trades, events, and agents. These wrappers keep counters type-safe and self-describing when they travel through the simulation.

Note: The built-in counters assume single-threaded access. To use the ID generators from multiple threads, replace the global Ref counters with Threads.Atomic values (or similar synchronization) so increments remain race-free.

StockMarketABM.IDs.AgentIdType
AgentId

Identifier for agents participating in the simulation. The backing type uses UInt32 because the agent population is typically smaller than the order flow.

source
StockMarketABM.IDs.OrderIdType
OrderId

Wrapper type for uniquely identifying orders. Storing the identifier in a dedicated struct prevents accidental mixing with other numeric counters.

source