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
8 namespace Selector {
9
24 class TournamentSelector : public Selector
25 {
26 protected:
33 std::set<const TPG::TPGVertex*> verticesToDelete;
34
35 public:
43 TournamentSelector(std::shared_ptr<TPG::TPGGraph> graph,
44 const Learn::LearningParameters& params)
45 : Selector{graph, params}
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
Mutator::RNG
Definition rng.h:52
Selector::Selector::params
const Learn::LearningParameters & params
Parameters for the selection.
Definition selector.h:26
Selector::Selector::graph
std::shared_ptr< TPG::TPGGraph > graph
TPGGraph on which the TPGVertex can be selected or deleted.
Definition selector.h:23
Selector::TournamentSelector
Selection class that will do a selection with a tournament.
Definition tournamentSelector.h:25
Selector::TournamentSelector::updateContext
virtual const SelectionContext & updateContext() override
Specialization of updateContext for tournament purposes.
Definition tournamentSelector.cpp:87
Selector::TournamentSelector::verticesToDelete
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
Selector::TournamentSelector::updateAfterPopulate
virtual void updateAfterPopulate() override
Specialization of updateAfterPopulate for tournament purposes.
Definition tournamentSelector.cpp:154
Selector::TournamentSelector::launchSelection
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
Selector::TournamentSelector::TournamentSelector
TournamentSelector(std::shared_ptr< TPG::TPGGraph > graph, const Learn::LearningParameters &params)
Constructor for Selector.
Definition tournamentSelector.h:43
Selector::TournamentSelector::doSelection
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
Selector::TournamentSelector::getVerticesToDelete
virtual const std::set< const TPG::TPGVertex * > & getVerticesToDelete()
getter of the verticesToDelete set.
Definition tournamentSelector.cpp:164
Selector::TournamentSelector::addToVerticesToDelete
void addToVerticesToDelete(const TPG::TPGVertex *vertex)
add a vertex to the verticesToDelete set.
Definition tournamentSelector.cpp:81
TPG::TPGVertex
Abstract class representing the vertices of a TPGGraph.
Definition tpgVertex.h:55
Selector
Definition mapElitesArchiveLogger.h:45
Learn::LearningParameters
Structure for simplifying the transmission of LearningParameters to functions.
Definition learningParameters.h:55
Selector::SelectionContext
Structure to interface between the selector and the TPGMutator.
Definition selectionContext.h:17