heuristicas.c
int ff(int task_id){
	int proc_address;
	int canditate_proc = -1;
	for(int i=0; i<MAX_CLUSTER_SLAVES; i++){
		proc_address = get_proc_address(i);
		if (get_proc_free_pages(proc_address) > 0){
			canditate_proc = proc_address;
			if (canditate_proc != -1){
				puts("Task mapping for task "), puts(itoa(task_id)); puts(" maped at proc "); puts(itoh(canditate_proc)); puts("\n");
				return canditate_proc;
			}
			putsv("WARNING: no resources available in cluster to map task ", task_id);
			return -1;
		}
	}
}
// heuristica FF - mapeia tarefa para o primeiro EP livre
heuristica FF - mapeia tarefa para o primeiro EP livre
heuristica FF - mapeia tarefa para o primeiro EP livre
int ff(int task_id){
	int proc_address;
	int canditate_proc = -1;
	for(int i=0; i<MAX_CLUSTER_SLAVES; i++){
		proc_address = get_proc_address(i);
		if (get_proc_free_pages(proc_address) > 0){
			canditate_proc = proc_address;
			if (canditate_proc != -1){
				puts("Task mapping for task "), puts(itoa(task_id)); puts(" maped at proc "); puts(itoh(canditate_proc)); puts("\n");
				return canditate_proc;
			}
			putsv("WARNING: no resources available in cluster to map task ", task_id);
			return -1;
		}
	}
}
int ff ( int task_id ) { int proc_address ; int canditate_proc = -1 ; for ( int i = 0 ; i < MAX_CLUSTER_SLAVES ; i ++ ) { proc_address = get_proc_address ( i ) ; if ( get_proc_free_pages ( proc_address ) > 0 ) { canditate_proc = proc_address ; if ( canditate_proc != -1 ) { puts ( " " ) , puts ( itoa ( task_id ) ) ; puts ( " " ) ; puts ( itoh ( canditate_proc ) ) ; puts ( " \n " ) ; return canditate_proc ; } putsv ( " " , task_id ) ; return -1 ; } } }
heuristica FF - mapeia tarefa para o primeiro EP livre
heuristica FF - mapeia tarefa para o primeiro EP livre