Simulation Engine

The simulator maintains an ordered queue of predicted events related to activities prescribed by the model and those recording the model's behavior.

Pascal favored linked lists and trees as dynamic storage. There have been many fixed sized arrays where dynamics was not required.

The Java implementation created objects were Pascal code used the almost object oriented WITH clauses. Where nested WITH clauses we had to choose one object to "own" that would more logically be shared.

The Java implementation had dynamic object inherit from the static Simulator so that global state would be conveniently accessed.

We will slowly replace static and linked structures with familiar javascript objects. We expect persistent bugs where index origin alternates between 1 and 0. Yuck.

# Objects

A Station collects the storage and logic that would be replicated for each repeater station.

A Message travels between Stations that hold them until they have channel capacity to pass it along the next hop.

Graph and Scatter objects held x vs y and y vs t data to be printed at end of run.

EventBlocks held future events to be dispatched when their time has come.

# Queues

Each Station has a messageQueue that holds Messages waiting to be sent. The Simulator has an eventQueue that holds events waiting to be processes. In both cases a javascript array replaces linked lists and priority trees.