#include "../includes/Projet.hpp" Projet::Projet() {} Projet::Projet(VecTaches t) : taches(t) {} Projet::~Projet() {} Projet::Projet(const Projet &) {} const Projet &Projet::operator=(const Projet &src) { if (this == &src) { return *this; } return *this; } std::pair Projet::pick_two_random_tasks() { int size = this->taches.size(); int rand1 = rand() % size; int rand2 = rand() % size; if (this->taches[rand1].first->depends_from(*this->taches[rand2].first)) pick_two_random_tasks(); // Heritage de tache ? int id1 = this->taches[rand1].first->unique_id; int id2 = this->taches[rand2].first->unique_id; return std::make_pair(id1, id2); } // Comment acceder à unique_id ici ? Tache *Projet::contains(int id) { for (auto t : this->taches) { if (id == t.first->unique_id) { return t.first; } } return nullptr; } // Comment acceder à taches ici ? std::ostream &operator<<(std::ostream &out, const Projet &data) { for (auto t : data.taches) { out << t.first << " is " << std::boolalpha << t.second; } return out; } const Projet::VecTaches Projet::topologicalSort() { // Recupere le calcul fait par PP_postfixe et construit son tri // PP_postfixe(this->taches); return VecTaches(); /* TODO */ }