aboutsummaryrefslogtreecommitdiff
path: root/include/HyperNeat/Utils/SaveFile.hpp
blob: 18cad38b91fae4248675931f9e6539e2f70544b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef __HYPERNEAT_SAVEFILE_HPP__
#define __HYPERNEAT_SAVEFILE_HPP__

#include <iostream>
#include <HyperNeat/Utils/String.hpp>
#include <HyperNeat/Utils/Vector.hpp>

namespace hyperneat
{
    using Ostream = std::ostream;

    class Genome;
    class Organism;
    class Population;
    class NoveltyMetric;
    class NeuralNetPrms;
    class PopulationPrms;
    class NoveltyMetricPrms;

    class SaveFile
    {
    public:
        SaveFile(Ostream& stream);

        void savePopulation(Population& population, bool shuttedDown = false, size_t tabs = 0,
            const String& prefix = "");
        void savePopulationPrms(const PopulationPrms& prms, size_t tabs = 0, const String& prefix = "");
        void saveNeuralNetPrms(const NeuralNetPrms& prms, size_t tabs = 0, const String& prefix = "");
        void saveOrganism(const Organism& organism, bool shuttedDown = false, size_t tabs = 0,
            const String& prefix = "");
        void saveGenome(const Genome& genome, size_t tabs = 0, const String& prefix = "");
        void saveNoveltyMetric(const NoveltyMetric& noveltyMetric, bool shuttedDown = false, size_t tabs = 0,
            const String& prefix = "");
        void saveNoveltyMetricPrms(const NoveltyMetricPrms& noveltyMetricPrms, size_t tabs = 0,
            const String& prefix = "");

    private:
        Ostream& print(size_t tabs = 0);
        String   newl(size_t lines = 1);

        Ostream& _stream;
    };
}

#endif