<commit_before>#include "gc/PopulationNodeDeallocator.hpp"
#include "core/PopulationNode.hpp"
#include <set>

PopulationNodeDeallocator::PopulationNodeDeallocator() {}
PopulationNodeDeallocator::~PopulationNodeDeallocator() {}

bool PopulationNodeDeallocator::canDeleteNode(PopulationNode * node) {
	return true;
}

void PopulationNodeDeallocator::deleteNodes() {
	std::set<Locus*> loci;
	std::set<EndCondition*> conditions;
	std::set<ObjectiveFunction*> objectives;
	std::set<ToStringFunction*> toStrings;

	for (int i = 0; i < this->nodes.size(); i++) {
		PopulationNode * temp = this->nodes[i];

		std::set<Locus*> tempLoci = temp->getLoci();
		loci.insert(tempLoci.begin(), tempLoci.end());

		vector<EndCondition*> tempConditions = temp->getConditions;
		conditions.insert(tempConditions.begin(), tempConditions.end());

		vector<ObjectiveFunction*> tempObjectives;
		objectives.insert(tempObjectives.begin(), tempObjectives.end());

		toStrings.insert(temp->getToString());
	}

	this->clearSet<Locus*>(loci);
	this->clearSet<EndCondition*>(conditions);
	this->clearSet<ObjectiveFunction*>(objectives);
	this->clearSet<ToStringFunction*>(toStrings);
}<commit_msg>[GC]: Fixed bugs in population node deallocator<commit_after>#include "gc/PopulationNodeDeallocator.hpp"
#include "core/PopulationNode.hpp"
#include <set>

PopulationNodeDeallocator::PopulationNodeDeallocator() {}
PopulationNodeDeallocator::~PopulationNodeDeallocator() {}

bool PopulationNodeDeallocator::canDeleteNode(PopulationNode * node) {
	return true;
}

void PopulationNodeDeallocator::deleteNodes() {
	std::set<Locus*> loci;
	std::set<EndCondition*> conditions;
	std::set<ObjectiveFunction*> objectives;
	std::set<ToStringFunction*> toStrings;

	for (int i = 0; i < this->nodes.size(); i++) {
		PopulationNode * temp = this->nodes[i];

		std::set<Locus*> tempLoci = temp->getLoci();
		loci.insert(tempLoci.begin(), tempLoci.end());

		vector<EndCondition*> tempConditions = temp->getConditions();
		conditions.insert(tempConditions.begin(), tempConditions.end());

		vector<ObjectiveFunction*> tempObjectives = temp->getObjectives();
		objectives.insert(tempObjectives.begin(), tempObjectives.end());

		toStrings.insert(temp->getToString());
	}

	this->clearSet<Locus*>(loci);
	this->clearSet<EndCondition*>(conditions);
	this->clearSet<ObjectiveFunction*>(objectives);
	this->clearSet<ToStringFunction*>(toStrings);
}
{'fraction_non_alphanumeric': 0.15776293823038398, 'fraction_numerical': 0.0008347245409015025, 'mean_word_length': 8.148854961832061, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 46, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2475337', 'n_tokens_mistral': 786, 'n_tokens_neox': 732, 'n_words': 111}