Overview
SimBaseClass is the root class you subclass (or instantiate directly) for every Basilisk simulation. It wraps the C-level SimModel object and exposes Python-level APIs for constructing processes, tasks, and modules, scheduling events, and running the simulation.
SimBaseClass
Constructor
TotalSim, empty task and process lists, the event map, and a BSKLogger.
Process and task setup
Creates a simulation process and registers it with the simulation engine.Returns a
simulationArchTypes.ProcessBaseClass object.Creates a simulation task with a fixed update rate.Returns a
simulationArchTypes.TaskBaseClass object.Adds a module to a named task and optionally sets its execution priority within that task.Raises
ValueError if TaskName does not match any registered task.Simulation execution
Calls
SelfInit() and Reset() on every module. You must call this before ExecuteSimulation().Sets the simulation stop time.
Runs the simulation until the configured stop time or until a terminal event fires.
Enables or disables a terminal progress bar during execution.
Task control
Enables a previously disabled task.
Prevents a task from executing without removing it.
Resets all modules in the named task at the current simulation time.
Visualization
Prints the process → task → module execution order to the terminal with color coding.
Renders a matplotlib figure showing the process/task/module hierarchy.
Event system
Registers a new event handler.All extra arguments are forwarded to
EventHandlerClass. See the EventHandlerClass section below.Activates or deactivates a named event.
Sets activity on all events except
currentEventName. Pass useIndex=True to restrict changes to events sharing the same index suffix.EventHandlerClass
Encapsulates an event’s check strategy, condition, and action.Unique name for this event.
Check interval in nanoseconds (default 1 s).
Whether the event starts active.
Function
(sim) -> bool. Called to test whether the event should fire. Mutually exclusive with conditionTime and conditionList.Function
(sim) -> None. Called when the condition returns True. Mutually exclusive with actionList.Fire the event at the first timestep at or after this nanosecond value. Mutually exclusive with
conditionFunction.If
True, the simulation terminates when this event fires.When
True, the event is checked only at exact multiples of eventRate. When False, the event is checked whenever eventRate has elapsed since the last check.Usage example
Module-level helpers
Writes a Python list into a SWIG-wrapped C array.
Reads a SWIG-wrapped C array into a Python list.
Interpolates multiple time-history arrays onto a common time base.
arrayList is a list of 2-D numpy arrays where column 0 is the time axis.