From 12984705bec3a996392b739288a1d50ab0712bc9 Mon Sep 17 00:00:00 2001 From: kdesnos Date: Thu, 15 Sep 2022 10:14:09 +0200 Subject: [PATCH] (RelEng) Clean other code smells. --- gegelatilib/include/mutator/tpgMutator.h | 5 ++--- gegelatilib/src/mutator/tpgMutator.cpp | 9 ++++----- test/mutatorTest.cpp | 8 +++----- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/gegelatilib/include/mutator/tpgMutator.h b/gegelatilib/include/mutator/tpgMutator.h index fdb16fa2..35d0caa5 100644 --- a/gegelatilib/include/mutator/tpgMutator.h +++ b/gegelatilib/include/mutator/tpgMutator.h @@ -144,7 +144,7 @@ namespace Mutator { * This function mutates the behavior of the given TPGEdge Program, * using the ProgramMutator functions, until the Program behavior is * unique according to recordings held in the given Archive. - * The Program mutation is applid systematically, and a call to + * The Program mutation is applied systematically, and a call to * MutateEdgeDestination is also made with a probability from the * given MutationParameters. * @@ -152,7 +152,6 @@ namespace Mutator { * stored. * \param[in] archive Archive used to assess the uniqueness of the * mutated Program behavior. - * \param[in] team the source TPGTeam of the edge. * \param[in] edge the TPGEdge whose destination will be altered. * \param[in] preExistingTeams the TPGTeam candidates for destination. * \param[in] preExistingActions the TPGAction candidates for @@ -166,7 +165,7 @@ namespace Mutator { */ void mutateOutgoingEdge( TPG::TPGGraph& graph, const Archive& archive, - const TPG::TPGTeam& team, const TPG::TPGEdge* edge, + const TPG::TPGEdge* edge, const std::vector& preExistingTeams, const std::vector& preExistingActions, std::list>& newPrograms, diff --git a/gegelatilib/src/mutator/tpgMutator.cpp b/gegelatilib/src/mutator/tpgMutator.cpp index a6d14958..2454ed81 100644 --- a/gegelatilib/src/mutator/tpgMutator.cpp +++ b/gegelatilib/src/mutator/tpgMutator.cpp @@ -236,8 +236,7 @@ void Mutator::TPGMutator::mutateEdgeDestination( } void Mutator::TPGMutator::mutateOutgoingEdge( - TPG::TPGGraph& graph, const Archive& archive, const TPG::TPGTeam& team, - const TPG::TPGEdge* edge, + TPG::TPGGraph& graph, const Archive& archive, const TPG::TPGEdge* edge, const std::vector& preExistingTeams, const std::vector& preExistingActions, std::list>& newPrograms, @@ -306,9 +305,9 @@ void Mutator::TPGMutator::mutateTPGTeam( // Edge->Program bid modification if (rng.getDouble(0.0, 1.0) < params.tpg.pProgramMutation) { // Mutate the edge - mutateOutgoingEdge(graph, archive, team, edge, - preExistingTeams, preExistingActions, - newPrograms, params, rng); + mutateOutgoingEdge(graph, archive, edge, preExistingTeams, + preExistingActions, newPrograms, params, + rng); anyMutationDone = true; } } diff --git a/test/mutatorTest.cpp b/test/mutatorTest.cpp index ff1b3436..8fad47bd 100644 --- a/test/mutatorTest.cpp +++ b/test/mutatorTest.cpp @@ -767,8 +767,7 @@ TEST_F(MutatorTest, TPGMutatorMutateOutgoingEdge) std::list> newPrograms; ASSERT_NO_THROW(Mutator::TPGMutator::mutateOutgoingEdge( - tpg, arch, vertex0, &edge0, {&vertex0}, {&vertex1}, newPrograms, params, - rng)); + tpg, arch, &edge0, {&vertex0}, {&vertex1}, newPrograms, params, rng)); // Check that progPointer use count was decreased since the mutated program // is a copy of the original @@ -862,9 +861,8 @@ TEST_F(MutatorTest, TPGMutatorMutateProgramBehaviorAgainstArchive) std::list> newPrograms; - Mutator::TPGMutator::mutateOutgoingEdge(tpg, arch, vertex0, &edge0, - {&vertex0}, {&vertex1}, newPrograms, - params, rng); + Mutator::TPGMutator::mutateOutgoingEdge( + tpg, arch, &edge0, {&vertex0}, {&vertex1}, newPrograms, params, rng); ASSERT_NO_THROW(Mutator::TPGMutator::mutateProgramBehaviorAgainstArchive( newPrograms.front(), params, arch, rng))