GEGELATI
Loading...
Searching...
No Matches
tournamentSelector.h
1
2
3#ifndef TOURNAMENT_SELECTOR_H
4#define TOURNAMENT_SELECTOR_H
5
6#include "selector/selector.h"
7
8namespace Selector {
9
25 {
26 protected:
33 std::set<const TPG::TPGVertex*> verticesToDelete;
34
35 public:
43 TournamentSelector(std::shared_ptr<TPG::TPGGraph> graph,
46 {
47 }
48
58 virtual void launchSelection(
59 std::multimap<std::shared_ptr<Learn::EvaluationResult>,
60 const TPG::TPGVertex*>& results,
61 Mutator::RNG& rng) override;
62
85 virtual void doSelection(
86 std::multimap<std::shared_ptr<Learn::EvaluationResult>,
87 const TPG::TPGVertex*>& results,
88 Mutator::RNG& rng) override;
89
95 void addToVerticesToDelete(const TPG::TPGVertex* vertex);
96
104 virtual const SelectionContext& updateContext() override;
105
112 virtual void updateAfterPopulate() override;
113
117 virtual const std::set<const TPG::TPGVertex*>& getVerticesToDelete();
118 };
119}; // namespace Selector
120
121#endif // TOURNAMENT_SELECTOR_H
Definition rng.h:52
const Learn::LearningParameters & params
Parameters for the selection.
Definition selector.h:26
std::shared_ptr< TPG::TPGGraph > graph
TPGGraph on which the TPGVertex can be selected or deleted.
Definition selector.h:23
Selection class that will do a selection with a tournament.
Definition tournamentSelector.h:25
virtual const SelectionContext & updateContext() override
Specialization of updateContext for tournament purposes.
Definition tournamentSelector.cpp:87
std::set< const TPG::TPGVertex * > verticesToDelete
set of TPGVertex filled during the selection process, containing the vertices that went through the t...
Definition tournamentSelector.h:33
virtual void updateAfterPopulate() override
Specialization of updateAfterPopulate for tournament purposes.
Definition tournamentSelector.cpp:154
virtual void launchSelection(std::multimap< std::shared_ptr< Learn::EvaluationResult >, const TPG::TPGVertex * > &results, Mutator::RNG &rng) override
override of doSelection method.
Definition tournamentSelector.cpp:5
TournamentSelector(std::shared_ptr< TPG::TPGGraph > graph, const Learn::LearningParameters &params)
Constructor for Selector.
Definition tournamentSelector.h:43
virtual void doSelection(std::multimap< std::shared_ptr< Learn::EvaluationResult >, const TPG::TPGVertex * > &results, Mutator::RNG &rng) override
override of doSelection method
Definition tournamentSelector.cpp:17
virtual const std::set< const TPG::TPGVertex * > & getVerticesToDelete()
getter of the verticesToDelete set.
Definition tournamentSelector.cpp:164
void addToVerticesToDelete(const TPG::TPGVertex *vertex)
add a vertex to the verticesToDelete set.
Definition tournamentSelector.cpp:81
Abstract class representing the vertices of a TPGGraph.
Definition tpgVertex.h:55
Definition mapElitesArchiveLogger.h:45
Structure for simplifying the transmission of LearningParameters to functions.
Definition learningParameters.h:55
Structure to interface between the selector and the TPGMutator.
Definition selectionContext.h:17