helics  2.8.1
Public Member Functions | Public Attributes | List of all members
helics::ForwardingTimeCoordinator Class Reference

#include <ForwardingTimeCoordinator.hpp>

Public Member Functions

void setMessageSender (std::function< void(const ActionMessage &)> userSendMessageFunction)
 
std::vector< global_federate_idgetDependencies () const
 
std::vector< global_federate_idgetDependents () const
 
void updateTimeFactors ()
 
const DependencyInfogetDependencyInfo (global_federate_id ofed) const
 
bool isDependency (global_federate_id ofed) const
 
bool empty () const
 
bool processTimeMessage (const ActionMessage &cmd)
 
void processDependencyUpdateMessage (const ActionMessage &cmd)
 
bool addDependency (global_federate_id fedID)
 
bool addDependent (global_federate_id fedID)
 
void removeDependency (global_federate_id fedID)
 
void removeDependent (global_federate_id fedID)
 
void setAsChild (global_federate_id fedID)
 
void setAsParent (global_federate_id fedID)
 
void disconnect ()
 
message_processing_result checkExecEntry ()
 
void enteringExecMode ()
 
std::string printTimeStatus () const
 
void generateDebuggingTimeInfo (Json::Value &base) const
 
bool hasActiveTimeDependencies () const
 
Time getNextTime () const
 
int dependencyCount () const
 
global_federate_id getMinDependency () const
 

Public Attributes

global_federate_id source_id {0}
 the identifier for inserting into the source id field of any generated messages;
 
global_federate_id delayedFederate {}
 
bool checkingExec {false}
 flag indicating that the coordinator is trying to enter the exec mode
 
bool executionMode {false}
 flag that the coordinator has entered the execution Mode
 
bool iterating {false}
 flag indicating that the min dependency is iterating
 
bool ignoreMinFed {false}
 
bool restrictive_time_policy {false}
 flag indicating that a restrictive time policy should be used
 
bool noParent {false}
 indicator that the coordinator does not have parents
 
bool hasDelayedTimingFederate {false}
 indicator that federate is using delayed timing
 

Detailed Description

class managing the coordination of time in HELICS for forwarding object (cores, brokers) the time coordinator manages dependencies and computes whether time can advance or enter execution mode

Member Function Documentation

◆ addDependency()

bool helics::ForwardingTimeCoordinator::addDependency ( global_federate_id  fedID)

add a federate dependency

Returns
true if it was actually added, false if the federate was already present

References helics::TimeDependencies::addDependency().

Referenced by processDependencyUpdateMessage().

◆ addDependent()

bool helics::ForwardingTimeCoordinator::addDependent ( global_federate_id  fedID)

add a dependent federate

Returns
true if it was actually added, false if the federate was already present

References helics::TimeDependencies::addDependent().

Referenced by processDependencyUpdateMessage().

◆ checkExecEntry()

message_processing_result helics::ForwardingTimeCoordinator::checkExecEntry ( )

◆ dependencyCount()

int helics::ForwardingTimeCoordinator::dependencyCount ( ) const

get a count of the active dependencies

References helics::TimeDependencies::activeDependencyCount().

◆ disconnect()

void helics::ForwardingTimeCoordinator::disconnect ( )

◆ empty()

bool helics::ForwardingTimeCoordinator::empty ( ) const
inline

check whether a timeCoordinator has any dependencies or dependents

References helics::TimeDependencies::empty().

◆ enteringExecMode()

void helics::ForwardingTimeCoordinator::enteringExecMode ( )

function to enter the exec Mode

References checkingExec, executionMode, noParent, helics::ActionMessage::source_id, and source_id.

◆ generateDebuggingTimeInfo()

void helics::ForwardingTimeCoordinator::generateDebuggingTimeInfo ( Json::Value &  base) const

generate debugging time information

◆ getDependencies()

std::vector< global_federate_id > helics::ForwardingTimeCoordinator::getDependencies ( ) const

get a list of actual dependencies

◆ getDependencyInfo()

const DependencyInfo * helics::ForwardingTimeCoordinator::getDependencyInfo ( global_federate_id  ofed) const

take a global id and get a pointer to the dependencyInfo for the other fed will be nullptr if it doesn't exist

References helics::TimeDependencies::getDependencyInfo().

◆ getDependents()

std::vector< global_federate_id > helics::ForwardingTimeCoordinator::getDependents ( ) const

get a reference to the dependents vector

◆ getMinDependency()

global_federate_id helics::ForwardingTimeCoordinator::getMinDependency ( ) const

get a count of the active dependencies

References helics::TimeDependencies::getMinDependency().

◆ getNextTime()

Time helics::ForwardingTimeCoordinator::getNextTime ( ) const
inline

get the current next time

References helics::TimeData::next.

◆ hasActiveTimeDependencies()

bool helics::ForwardingTimeCoordinator::hasActiveTimeDependencies ( ) const

check if there are any active Time dependencies

References helics::TimeDependencies::hasActiveTimeDependencies().

◆ isDependency()

bool helics::ForwardingTimeCoordinator::isDependency ( global_federate_id  ofed) const

check whether a federate is a dependency

References helics::TimeDependencies::isDependency().

◆ printTimeStatus()

std::string helics::ForwardingTimeCoordinator::printTimeStatus ( ) const

generate a string with the current time status

References helics::TimeData::minDe, helics::TimeData::next, and helics::TimeData::Te.

◆ processDependencyUpdateMessage()

void helics::ForwardingTimeCoordinator::processDependencyUpdateMessage ( const ActionMessage cmd)

◆ processTimeMessage()

bool helics::ForwardingTimeCoordinator::processTimeMessage ( const ActionMessage cmd)

process a message related to time

Returns
a message_process_result if it did anything

References removeDependent().

Referenced by disconnect().

◆ removeDependency()

void helics::ForwardingTimeCoordinator::removeDependency ( global_federate_id  fedID)

remove a dependency

Parameters
fedIDthe identifier of the federate to remove

References helics::TimeDependencies::removeDependency().

Referenced by processDependencyUpdateMessage().

◆ removeDependent()

void helics::ForwardingTimeCoordinator::removeDependent ( global_federate_id  fedID)

remove a dependent

Parameters
fedIDthe identifier of the federate to remove

References helics::TimeDependencies::removeDependent().

Referenced by processDependencyUpdateMessage(), and processTimeMessage().

◆ setMessageSender()

void helics::ForwardingTimeCoordinator::setMessageSender ( std::function< void(const ActionMessage &)>  userSendMessageFunction)
inline

set the callback function used for the sending messages

◆ updateTimeFactors()

void helics::ForwardingTimeCoordinator::updateTimeFactors ( )

Member Data Documentation

◆ ignoreMinFed

bool helics::ForwardingTimeCoordinator::ignoreMinFed {false}

flag indicating that minFed Controls should not be used


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