Line data Source code
1 : //* This file is part of the MOOSE framework 2 : //* https://mooseframework.inl.gov 3 : //* 4 : //* All rights reserved, see COPYRIGHT for full restrictions 5 : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT 6 : //* 7 : //* Licensed under LGPL 2.1, please see LICENSE for details 8 : //* https://www.gnu.org/licenses/lgpl-2.1.html 9 : 10 : #ifdef MOOSE_LIBTORCH_ENABLED 11 : 12 : #pragma once 13 : 14 : #include "LibtorchDRLControlTrainer.h" 15 : #include "GeneralReporter.h" 16 : #include "SurrogateModelInterface.h" 17 : 18 : /// Reporter which saves the reward values from a Deep Reinforcement Learning controller trainer 19 : class DRLRewardReporter : public GeneralReporter, public SurrogateModelInterface 20 : { 21 : public: 22 : static InputParameters validParams(); 23 : DRLRewardReporter(const InputParameters & parameters); 24 8 : virtual void initialize() override {} 25 8 : virtual void finalize() override {} 26 : virtual void execute() override; 27 : 28 : protected: 29 : /// The reward values which will be saved 30 : Real & _reward; 31 : /// The DRL trainer which computes the reward values 32 : LibtorchDRLControlTrainer & _trainer; 33 : }; 34 : 35 : #endif