helics  3.0.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< GlobalFederateIdgetDependencies () const
 
std::vector< GlobalFederateIdgetDependents () const
 
void updateTimeFactors ()
 
const DependencyInfogetDependencyInfo (GlobalFederateId ofed) const
 
bool isDependency (GlobalFederateId ofed) const
 
bool empty () const
 
bool processTimeMessage (const ActionMessage &cmd)
 
void processDependencyUpdateMessage (const ActionMessage &cmd)
 
bool addDependency (GlobalFederateId fedID)
 
bool addDependent (GlobalFederateId fedID)
 
void removeDependency (GlobalFederateId fedID)
 
void removeDependent (GlobalFederateId fedID)
 
void setAsChild (GlobalFederateId fedID)
 
void setAsParent (GlobalFederateId fedID)
 
void disconnect ()
 
MessageProcessingResult checkExecEntry ()
 
void enteringExecMode ()
 
std::string printTimeStatus () const
 
void generateDebuggingTimeInfo (Json::Value &base) const
 
bool hasActiveTimeDependencies () const
 
Time getNextTime () const
 
int dependencyCount () const
 
GlobalFederateId getMinDependency () const
 

Public Attributes

GlobalFederateId source_id {0}
 the identifier for inserting into the source id field of any generated messages;
 
GlobalFederateId 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 ( GlobalFederateId  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 ( GlobalFederateId  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()

MessageProcessingResult 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< GlobalFederateId > helics::ForwardingTimeCoordinator::getDependencies ( ) const

get a list of actual dependencies

◆ getDependencyInfo()

const DependencyInfo * helics::ForwardingTimeCoordinator::getDependencyInfo ( GlobalFederateId  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< GlobalFederateId > helics::ForwardingTimeCoordinator::getDependents ( ) const

get a reference to the dependents vector

◆ getMinDependency()

GlobalFederateId 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 ( GlobalFederateId  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 ( GlobalFederateId  fedID)

remove a dependency

Parameters
fedIDthe identifier of the federate to remove

References helics::TimeDependencies::removeDependency().

Referenced by processDependencyUpdateMessage().

◆ removeDependent()

void helics::ForwardingTimeCoordinator::removeDependent ( GlobalFederateId  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: