Antares Xpansion
Investment simulations for Antares studies
Loading...
Searching...
No Matches
UserFile.h
1#ifndef ANTARESXPANSION_CONSOLE_H
2#define ANTARESXPANSION_CONSOLE_H
3
4#include <cstdio>
5#include <filesystem>
6#include <fstream>
7#include <ostream>
8
9#include "antares-xpansion/xpansion_interfaces/ILogger.h"
10#include "antares-xpansion/benders/logger/User.h"
11
12namespace xpansion {
13namespace logger {
14
15class UserFile : public ILogger {
16 public:
17 explicit UserFile(const std::filesystem::path &filename);
18 ~UserFile();
19
20 void display_message(const std::string &str) override;
21 void display_message(const std::string &str, LogUtils::LOGLEVEL level,
22 const std::string &context) override;
23
24 virtual void PrintIterationSeparatorBegin() override;
25 virtual void PrintIterationSeparatorEnd() override;
26
27 void log_at_initialization(const int it_number) override;
28
29 void log_iteration_candidates(const LogData &d) override;
30
31 void log_master_solving_duration(double durationInSeconds) override;
32
33 void LogSubproblemsSolvingWalltime(double durationInSeconds) override;
34
35 void LogSubproblemsSolvingCumulativeCpuTime(
36 double durationInSeconds) override;
37
38 void log_at_iteration_end(const LogData &d) override;
39
40 void log_at_ending(const LogData &d) override;
41
42 void log_total_duration(double durationInSeconds) override;
43
44 void log_stop_criterion_reached(
45 const StoppingCriterion stopping_criterion) override;
46 void display_restart_message() override;
47 void restart_elapsed_time(const double elapsed_time) override;
48 void number_of_iterations_before_restart(const int num_iterations) override;
49 void restart_best_iteration(const int best_iterations) override;
50 void restart_best_iterations_infos(
51 const LogData &best_iterations_data) override;
52 void LogAtInitialRelaxation() override;
53 void LogAtSwitchToInteger() override;
54 void cumulative_number_of_sub_problem_solved(int number) override;
55
56 private:
57 std::ofstream _file;
58 std::string _filename;
59};
60
61} // namespace logger
62} // namespace xpansion
63
64#endif // ANTARESXPANSION_CONSOLE_H
abstract class for operational logs
Definition ILogger.h:150
Definition UserFile.h:15
void display_message(const std::string &str) override
pure virtual method to display a std::string message
Definition UserFile.cpp:33
Definition ILogger.h:48