#include "pro.h" //Señal de cierre static void sig_usr(int signo){ if (signo == SIGINT||SIGSEGV){ system("pkill octave-cli"); exit(1); } return; } //Funcion Principal int main(int argc, char *argv[]){ atexit(salir); //Señales de interrupcion if (signal(SIGINT, sig_usr) == SIG_ERR) err_sys("can't catch the signal"); if (signal(SIGSEGV, sig_usr) == SIG_ERR) err_sys("can't catch the signal"); system("clear"); if (argc==1){ experimentos=1; } else if (!strcmp(argv[1],"t")){ i=0; do{ if(!i){ i++; printf("Determine la cantidad de experimentos a realizar:"); } scanf("%s",&exper); c=getchar(); experimentos=atoi(&exper); if(i&!experimentos) printf("Debe ingresar un numero:"); }while (!experimentos); printf("\n"); } else{ printf("Debe ingresar t como parametro opcional\n"); exit(1); } //Ingreso de datos por pantalla ingreso_datos(); //Variables para almacenamiento de datos. float inst[cantidad]; //Instante de llegada de cada paquete float inst2[cantidad]; //Instante de llegada de cada paquete float time[cantidad]; //Tiempos de atencion float inst_cola[cantidad]; float entre_reduce[cantidad]; float wait_time[cantidad]; float system_time[cantidad]; //Llamada a Octave forkOctave(); //Manejo de hebras pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); //Para datos acumulados para k experimentos float largo_cola_acum=0; float tiempo_espera_acum=0; float tiempo_sistema_acum=0; float tasa_de_ocupacion_acum=0; //Loop para hacer "d" cantidad de experimentos for(d=0;d