#include "Graf.h" /** * the constructor * * @param i the id * @param c the cost */ Task::Task(int i, double c) : Nod(i, c) { niv_topo_min = -1; niv_topo_max = -1; procesor_id = -1; start = -1; stop = -1; } /** * the default initialization */ void Task::init(){ procesor_id=-1; start = -1; stop = -1; } /** * Method that assocites to the current task a processor scheduling it to be executed between "st" and "fin" * * @param id the id of the associated processor * @param st the start moment * @param fin the stop moment */ void Task::setProcesor(int id, int st, int fin) { procesor_id = id; start = st; stop = fin; } /* bool Task::operator<(const Task & t1, const Task & t2){ return t1.niv_topo_min < t2.niv_topo_min; } */ /** * method printing the task's information */ void Task::print() { printf("[Task id = %i cost = %lf min = %i max = %i (%i, %i) proc = %i pred{ ", id, cost, niv_topo_min, niv_topo_max, start, stop, procesor_id); for(int i = 0 ; i < nr_pred ; i ++) printf("%i(%lf) ", ((Muchie*)predecesori[i])->predecesor->id, ((Muchie*)predecesori[i])->cost); printf("} succ { "); for(int i = 0 ; i < nr_succ ; i ++) printf("%i(%lf) ", ((Muchie*)succesori[i])->succesor->id, ((Muchie*)succesori[i])->cost); printf("}]\n"); }