GEGELATI
Loading...
Searching...
No Matches
tournamentSelector.h
1
36#ifndef TOURNAMENT_SELECTOR_H
37#define TOURNAMENT_SELECTOR_H
38
39#include "selector/selector.h"
40
41namespace Selector {
42
58 {
59 protected:
66 std::set<const TPG::TPGVertex*> verticesToDelete;
67
68 public:
76 TournamentSelector(std::shared_ptr<TPG::TPGGraph> graph,
79 {
80 }
81
91 virtual void launchSelection(
92 std::multimap<std::shared_ptr<Learn::EvaluationResult>,
93 const TPG::TPGVertex*>& results,
94 Mutator::RNG& rng) override;
95
118 virtual void doSelection(
119 std::multimap<std::shared_ptr<Learn::EvaluationResult>,
120 const TPG::TPGVertex*>& results,
121 Mutator::RNG& rng) override;
122
128 void addToVerticesToDelete(const TPG::TPGVertex* vertex);
129
137 virtual const SelectionContext& updateContext() override;
138
145 virtual void updateAfterPopulate() override;
146
150 virtual const std::set<const TPG::TPGVertex*>& getVerticesToDelete();
151 };
152}; // namespace Selector
153
154#endif // TOURNAMENT_SELECTOR_H
Definition rng.h:52
const Learn::LearningParameters & params
Parameters for the selection.
Definition selector.h:59
std::shared_ptr< TPG::TPGGraph > graph
TPGGraph on which the TPGVertex can be selected or deleted.
Definition selector.h:56
Selection class that will do a selection with a tournament.
Definition tournamentSelector.h:58
virtual const SelectionContext & updateContext() override
Specialization of updateContext for tournament purposes.
Definition tournamentSelector.cpp:120
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:66
virtual void updateAfterPopulate() override
Specialization of updateAfterPopulate for tournament purposes.
Definition tournamentSelector.cpp:187
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:38
TournamentSelector(std::shared_ptr< TPG::TPGGraph > graph, const Learn::LearningParameters &params)
Constructor for Selector.
Definition tournamentSelector.h:76
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:50
virtual const std::set< const TPG::TPGVertex * > & getVerticesToDelete()
getter of the verticesToDelete set.
Definition tournamentSelector.cpp:197
void addToVerticesToDelete(const TPG::TPGVertex *vertex)
add a vertex to the verticesToDelete set.
Definition tournamentSelector.cpp:114
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:56
Structure to interface between the selector and the TPGMutator.
Definition selectionContext.h:50