ModelSpace
All Classes Namespaces Functions Variables Enumerations Pages
RateMonitor.h
1/******************************************************************************
2* Copyright (c) ATTX LLC 2024. All Rights Reserved.
3*
4* This software and associated documentation (the "Software") are the
5* proprietary and confidential information of ATTX, LLC. The Software is
6* furnished under a license agreement between ATTX and the user organization
7* and may be used or copied only in accordance with the terms of the agreement.
8* Refer to 'license/attx_license.adoc' for standard license terms.
9*
10* EXPORT CONTROL NOTICE: THIS SOFTWARE MAY INCLUDE CONTENT CONTROLLED UNDER THE
11* INTERNATIONAL TRAFFIC IN ARMS REGULATIONS (ITAR) OR THE EXPORT ADMINISTRATION
12* REGULATIONS (EAR99). No part of the Software may be used, reproduced, or
13* transmitted in any form or by any means, for any purpose, without the express
14* written permission of ATTX, LLC.
15******************************************************************************/
16/*
17Rate Monitor header file
18
19Author: Alex Reynolds
20*/
21#ifndef MONITORS_RATE_MONITOR_H
22#define MONITORS_RATE_MONITOR_H
23
24#include "architecture/Executive.h"
25#include "architecture/Tasks.h"
26#include "architecture/Time.h"
27#include "data_management/GraphTreeObject.h"
28#include "data_management/DataIO.hpp"
29#include "core/clockwerkerrors.h"
30#include "simulation/SimulationSteps.h"
31
32namespace modelspace {
33
34 /// @brief Monitor to trigger at a particular rate
35
36 /// The rate monitor is a simple implementation of the monitor
37 /// that triggers at a set rate. The rate is set upon construction,
38 /// but may be changed during run via function.
39
40 /// If the simulation run rate is less than the monitor rate,
41 /// the monitor will simply trigger every step
42 class RateMonitor : public clockwerk::Monitor {
43 public:
44 /// Overloaded onstructors for the model object -- requires executive and (optional) name
45 RateMonitor(clockwerk::Task &pnt, const std::string &m_name="rate_monitor")
46 : clockwerk::Monitor(pnt, ALL, m_name) {}
47 RateMonitor(clockwerk::Executive &e, const std::string &m_name="rate_monitor")
48 : clockwerk::Monitor(e, ALL, m_name) {}
49 RateMonitor(clockwerk::Task &pnt, int schedule_slot, const std::string &m_name="rate_monitor")
50 : clockwerk::Monitor(pnt, schedule_slot, m_name) {}
51 RateMonitor(clockwerk::Executive &e, int schedule_slot, const std::string &m_name="rate_monitor")
52 : clockwerk::Monitor(e, schedule_slot, m_name) {}
53 ~RateMonitor() {};
54
55 /// @brief Function to check our current (base) time against
56 /// our rate conditions
57 /// @return Error code corresponding to success/failure
58 /// @note Will NOT run if trigger and persistence are true
59 int execute();
60
62 /// This is the rate at which the monitor will trigger
63 SIGNAL(rate, clockwerk::Time, clockwerk::Time(1,0))
65
67 /// This is the current time in the simulation
68 SIGNAL(current_time, clockwerk::Time, clockwerk::Time(0,0))
70
72 /// This is the next time at which the monitor will trigger
73 SIGNAL(next_trigger_time, clockwerk::Time, clockwerk::Time(0,0))
75 protected:
76
77 };
78
79}
80
81#endif
DataIO(GraphTreeObject *data_parent, std::string data_name, T initial_value)
Constructor for the DataIO object.
Definition DataIO.hpp:134
Central control mechanism to run simulations and software.
Definition Executive.h:43
Base class implementation of the monitor.
Definition Tasks.h:212
Monitor(Executive &executive, int schedule_slot=0, const std::string &m_name="Unnamed")
Executive-based constructor for the task.
Definition Tasks.h:232
Monitor(Task &pnt, int schedule_slot=0, const std::string &m_name="Unnamed")
Task-based constructor for the task. Auto-assigns executive.
Definition Tasks.h:224
This is the base implementation of the task class.
Definition Tasks.h:68
Wrapper to manage and convert time as timespce.
Definition Time.h:45
Monitor to trigger at a particular rate.
Definition RateMonitor.h:42
RateMonitor(clockwerk::Task &pnt, const std::string &m_name="rate_monitor")
Overloaded onstructors for the model object – requires executive and (optional) name.
Definition RateMonitor.h:45
int execute()
Function to check our current (base) time against our rate conditions.
Definition RateMonitor.cpp:23
#define SIGNAL(NAME, TYPE, INITIAL_VALUE)
Definition macros.h:87
#define START_PARAMS
Definition macros.h:96
#define END_OUTPUTS
Definition macros.h:90
#define END_PARAMS
Definition macros.h:98
#define START_OUTPUTS
Definition macros.h:88
#define END_INPUTS
Definition macros.h:94
#define START_INPUTS
Definition macros.h:92
Class to propagate CR3BP dynamics in characteristic units.
Definition ConfigurationWriter.cpp:18
clockwerk::DataIO< clockwerk::Time > current_time
This is the current time in the simulation.
Definition RateMonitor.h:68
clockwerk::DataIO< clockwerk::Time > next_trigger_time
This is the next time at which the monitor will trigger.
Definition RateMonitor.h:73
clockwerk::DataIO< clockwerk::Time > rate
This is the rate at which the monitor will trigger.
Definition RateMonitor.h:63