ModelSpace
All Classes Namespaces Functions Variables Enumerations Pages
BiasNoiseModel.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/*
17Bias and noise model header file
18
19Author: Alex Reynolds
20*/
21
22#ifndef MODELS_SUPPORT_BIAS_NOISE_MODEL_H
23#define MODELS_SUPPORT_BIAS_NOISE_MODEL_H
24
25#include "core/macros.h"
26#include "simulation/Model.h"
27#include "simulation/NormalRandom.hpp"
28
29namespace modelspace {
30
31 /**
32 * @brief Bias and noise model
33 *
34 * This model perturbs a single output according to a bias and noise value
35 * configured at start time. Distribution is gaussian.
36 *
37 * @author Alex Reynolds <alex.reynolds@attx.tech>
38 */
39 class BiasNoiseModel : public Model {
40 public:
41 // Model params
42 // NAME TYPE DEFAULT VALUE
44 /** The bias in the object as a raw, constant error across all draws for the entire simulation */
45 SIGNAL(bias, double, 0.0)
46 /** The standard deviation of noise in the object as a gaussian random noise */
47 SIGNAL(noise_std, double, 0.0)
48 /** Value to seed the internal RNG for this model. */
49 SIGNAL(seed_value, int, 0)
51
52 // Model inputs
53 // NAME TYPE DEFAULT VALUE
55 /** The input value to be perturbed by noise and bias */
56 SIGNAL(input_val, double, 0.0)
58
59 // Model outputs
60 // NAME TYPE DEFAULT VALUE
62 /** The output value as perturbed by noise and bias */
63 SIGNAL(output_val, double, 0.0)
65
66 // Model-specific implementations of startup and derivative
67 BiasNoiseModel();
68 BiasNoiseModel(Model &pnt, const std::string &m_name="bias_noise");
69 BiasNoiseModel(SimulationExecutive &e, const std::string &m_name="bias_noise");
70 BiasNoiseModel(Model &pnt, int schedule_slot, const std::string &m_name="bias_noise");
71 BiasNoiseModel(SimulationExecutive &e, int schedule_slot, const std::string &m_name="bias_noise");
72 ~BiasNoiseModel() {}
73
74 protected:
75 int start();
76 int execute();
77
78 /// @brief RNG to produce our distribution.
79 NormalRandom<double> *_rng = nullptr;
80 };
81
82}
83
84#endif
Bias and noise model.
Definition BiasNoiseModel.h:39
int execute()
Function to execute the task. All math and calculations should be here.
Definition BiasNoiseModel.cpp:44
int start()
Function to perform task startup activities (step once after creation)
Definition BiasNoiseModel.cpp:33
NormalRandom< double > * _rng
RNG to produce our distribution.
Definition BiasNoiseModel.h:79
Base model class for derived implementation.
Definition Model.h:56
Class to generate random numbers according to normal distribution.
Definition NormalRandom.hpp:40
Implementation of the executive class for simulation.
Definition SimulationExecutive.h:63
#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< double > input_val
Definition BiasNoiseModel.h:56
clockwerk::DataIO< double > output_val
Definition BiasNoiseModel.h:63
clockwerk::DataIO< int > seed_value
Definition BiasNoiseModel.h:49
clockwerk::DataIO< double > bias
Definition BiasNoiseModel.h:45
clockwerk::DataIO< double > noise_std
Definition BiasNoiseModel.h:47