Icarus
Vehicle Simulation as a Transformable Computational Graph, built on Vulcan and Janus
Loading...
Searching...
No Matches
icarus::Scheduler Class Reference

Group-based execution scheduler. More...

#include <Scheduler.hpp>

Collaboration diagram for icarus::Scheduler:

Public Member Functions

void Configure (const SchedulerConfig &config, double sim_rate_hz)
 Configure scheduler from config.
std::vector< std::string > GetGroupsForFrame (int frame_count, int32_t current_phase=-1) const
 Get groups that should execute on this frame.
std::vector< std::string > GetMembersForGroup (const std::string &group_name) const
 Get members for a group in execution order.
double GetGroupDt (const std::string &group_name) const
 Get dt for a specific group.
int GetFrameDivisor (const std::string &group_name) const
 Get frame divisor for a group.
double GetSimulationRate () const
 Get simulation rate in Hz.
const std::vector< SchedulerGroupConfig > & GetGroups () const
 Get the sorted groups (by priority).
const SchedulerConfigGetConfig () const
 Get the config.
void LogExecutionOrder (MissionLogger *logger=nullptr) const
 Log execution order to logger or stdout.

Public Attributes

SchedulerConfig config_
double sim_rate_hz_ = 400.0

Detailed Description

Group-based execution scheduler.

Manages component execution order based on:

  • Group priority (which group runs first)
  • Member priority (which component runs first within a group)
  • Frame divisors (multi-rate: group runs when frame_count % divisor == 0)

Each group has a rate_hz. The simulation runs at the fastest rate. Slower groups have divisor > 1 and run less frequently.

Member Function Documentation

◆ Configure()

void icarus::Scheduler::Configure ( const SchedulerConfig & config,
double sim_rate_hz )
inline

Configure scheduler from config.

Parameters
configScheduler configuration with groups
sim_rate_hzGlobal simulation rate (fastest group rate)

◆ GetConfig()

const SchedulerConfig & icarus::Scheduler::GetConfig ( ) const
inlinenodiscard

Get the config.

◆ GetFrameDivisor()

int icarus::Scheduler::GetFrameDivisor ( const std::string & group_name) const
inlinenodiscard

Get frame divisor for a group.

Parameters
group_nameName of the group
Returns
Frame divisor (1 = runs every frame)

◆ GetGroupDt()

double icarus::Scheduler::GetGroupDt ( const std::string & group_name) const
inlinenodiscard

Get dt for a specific group.

Parameters
group_nameName of the group
Returns
Time step for that group (global_dt * divisor)

◆ GetGroups()

const std::vector< SchedulerGroupConfig > & icarus::Scheduler::GetGroups ( ) const
inlinenodiscard

Get the sorted groups (by priority).

◆ GetGroupsForFrame()

std::vector< std::string > icarus::Scheduler::GetGroupsForFrame ( int frame_count,
int32_t current_phase = -1 ) const
inlinenodiscard

Get groups that should execute on this frame.

Parameters
frame_countCurrent frame number (0-indexed)
current_phaseCurrent flight phase (-1 to ignore phase filtering)
Returns
Vector of group names that should execute

◆ GetMembersForGroup()

std::vector< std::string > icarus::Scheduler::GetMembersForGroup ( const std::string & group_name) const
inlinenodiscard

Get members for a group in execution order.

Parameters
group_nameName of the group
Returns
Vector of component names in execution order

◆ GetSimulationRate()

double icarus::Scheduler::GetSimulationRate ( ) const
inlinenodiscard

Get simulation rate in Hz.

◆ LogExecutionOrder()

void icarus::Scheduler::LogExecutionOrder ( MissionLogger * logger = nullptr) const
inline

Log execution order to logger or stdout.

Member Data Documentation

◆ config_

SchedulerConfig icarus::Scheduler::config_

◆ sim_rate_hz_

double icarus::Scheduler::sim_rate_hz_ = 400.0

The documentation for this class was generated from the following file: