sim_model

class SimModel
#include <sim_model.h>

The top-level container for an entire simulation.

Public Functions

SimModel()

The SimModel constructor.

This Constructor is used to initialize the top-level sim model.

~SimModel()

SimModel destructor.

Nothing to destroy really

void selfInitSimulation()

Method to initialize all added Tasks.

This method goes through all of the processes in the simulation, all of the tasks within each process, and all of the models within each task and self-inits them.

Returns

void

void resetInitSimulation()

Method to reset all added tasks.

This method goes through all of the processes in the simulation, all of the tasks within each process, and all of the models within each task and resets them.

Returns

void

void StepUntilStop(uint64_t SimStopTime, int64_t stopPri)

Step simulation until stop time uint64_t reached.

This method steps the simulation until the specified stop time and stop priority have been reached.

Parameters
  • SimStopTime – Nanoseconds to step the simulation for

  • stopPri – The priority level below which the sim won’t go

Returns

void

void SingleStepProcesses(int64_t stopPri = -1)

Step only the next Task in the simulation.

This method steps all of the processes forward to the current time. It also increments the internal simulation time appropriately as the simulation processes are triggered

Parameters

stopPri – The priority level below which the sim won’t go

Returns

void

void addNewProcess(SysProcess *newProc)

This method allows the user to attach a process to the simulation for execution. Note that the priority level of the process determines what order it gets called in: higher priorities are called before lower priorities. If priorities are the same, the proc added first goes first.

Parameters

newProc – the new process to be added

Returns

void

void ResetSimulation()

Reset simulation back to zero.

This method is used to reset a simulation to time 0. It sets all process and tasks back to the initial call times. It clears all message logs. However, it does not clear all message buffers and does not reset individual models.

Returns

void

Public Members

BSKLogger bskLogger

BSK Logging

std::vector<SysProcess*> processList

List of processes we’ve created

std::string SimulationName

Identifier for Sim

uint64_t CurrentNanos

[ns] Current sim time

uint64_t NextTaskTime

[ns] time for the next Task

int64_t nextProcPriority

[-] Priority level for the next process