SEVN
Loading...
Searching...
No Matches
evolve_utility::EvolveRecordCondition Class Reference

#include <evolve.h>

Inheritance diagram for evolve_utility::EvolveRecordCondition:
evolve_utility::EvolveFunctor evolve_utility::EvolveBHMS evolve_utility::EvolveRRL evolve_utility::EvolveW1

Public Member Functions

 EvolveRecordCondition (SevnLogging &svlog, bool record_state=true, bool include_failed=false)
 
virtual int operator() (Binstar &binary) override
 
virtual int operator() (Star &star) override
 
std::string name () override
 
virtual int operator() (_UNUSED Binstar &binary)
 
virtual int operator() (_UNUSED Star &star)
 

Static Public Member Functions

template<typename System >
static bool check_stalling (System &system)
 

Protected Member Functions

virtual bool record_condition (_UNUSED Binstar &binstar)
 
virtual bool record_condition (_UNUSED Star &star)
 
template<class System >
void final_print (System &system, bool evolution_result)
 

Static Protected Member Functions

template<class System >
static void catched_error_message (System &system, const sevnstd::sevnerr &e)
 
static long elapsed_time (std::chrono::steady_clock::time_point start_clock)
 

Protected Attributes

SevnLogging_svlog
 
const bool _record_state
 
const bool _include_failed
 
const Options_options
 

Detailed Description

Evolve functor template that can be used to create Functor that record (and print) only if given conditions are fulfilled. @record_state_policy The state is recorded only when the conditions in the method record_condition are fulfilled and if record_state is set to true. The information to record depends on the dtout option, dtout=end record only the the first and the last time the condition are fulfilled @break_evolve_policy The evolution is stopped when a break trigger is set to true (depening on the tf option in input). @Extra_options Not used @binstar_evolve Yes @star_evolve Yes @catch sevnerr

Constructor & Destructor Documentation

◆ EvolveRecordCondition()

evolve_utility::EvolveRecordCondition::EvolveRecordCondition ( SevnLogging svlog,
bool  record_state = true,
bool  include_failed = false 
)
inlineexplicit

Member Function Documentation

◆ catched_error_message()

template<class System >
static void evolve_utility::EvolveFunctor::catched_error_message ( System &  system,
const sevnstd::sevnerr e 
)
inlinestaticprotectedinherited

Special error message printed to std::cerr. This message is always print do not throw errors and can be used to print a message of a catched error during during a system evolution

Parameters
eInstance of Sevnerror
system_namename of the system (sytem.get_name())
system_IDID of the system (system.get_ID())

◆ check_stalling()

template<typename System >
static bool evolve_utility::EvolveFunctor::check_stalling ( System &  system)
inlinestaticinherited

Check if the system has been evolving for more than a given threshold (standard 20 s) If this is the case throw a sevnerror The check is performed only if the option check_stalling is set to true @TODO it could be better to move the check_stalling parameter from bool to double including the maximum time allowed for the evolution

Template Parameters
SystemAn object of the class Star or Binary
Parameters
systemthe system for which we want to check if the evolution is stalling
Returns
EXIT success if the system is not stalling otherwise throw an error @error throw a sevnerror if the system has been evolving for more than the second set as threshold

◆ elapsed_time()

static long evolve_utility::EvolveFunctor::elapsed_time ( std::chrono::steady_clock::time_point  start_clock)
inlinestaticprotectedinherited

Measure the elapsed time in seconds from a given starting clock

Parameters
start_clock,aninstance of std::chrono::steady_clock::time_point, the elapsed time is estimated from this point
Returns
elapsed time in seconds (approximated to the nearest integer)

◆ final_print()

template<class System >
void evolve_utility::EvolveFunctor::final_print ( System &  system,
bool  evolution_result 
)
inlineprotectedinherited

◆ name()

std::string evolve_utility::EvolveRecordCondition::name ( )
inlineoverridevirtual

◆ operator()() [1/4]

virtual int evolve_utility::EvolveFunctor::operator() ( _UNUSED Binstar binary)
inlinevirtualinherited

◆ operator()() [2/4]

◆ operator()() [3/4]

virtual int evolve_utility::EvolveRecordCondition::operator() ( Binstar binary)
inlineoverridevirtual

Evolve

◆ operator()() [4/4]

virtual int evolve_utility::EvolveRecordCondition::operator() ( Star star)
inlineoverridevirtual

Evolve

◆ record_condition() [1/2]

virtual bool evolve_utility::EvolveRecordCondition::record_condition ( _UNUSED Binstar binstar)
inlineprotectedvirtual

◆ record_condition() [2/2]

virtual bool evolve_utility::EvolveRecordCondition::record_condition ( _UNUSED Star star)
inlineprotectedvirtual

Member Data Documentation

◆ _include_failed

const bool evolve_utility::EvolveFunctor::_include_failed
protectedinherited

◆ _options

const Options* evolve_utility::EvolveFunctor::_options
protectedinherited

◆ _record_state

const bool evolve_utility::EvolveFunctor::_record_state
protectedinherited

◆ _svlog

SevnLogging& evolve_utility::EvolveFunctor::_svlog
protectedinherited

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