Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: main.cpp
- Revision:
- 3:2191cc27f1c4
- Parent:
- 2:789421c43e73
- Child:
- 4:2c93a9f6c9fd
--- a/main.cpp Mon Nov 16 15:49:34 2015 +0000 +++ b/main.cpp Sat Nov 28 03:17:56 2015 +0000 @@ -11,6 +11,7 @@ float S = 0.1; //Probabilidad de llegada a Q1 (vs. Salida) double t=0; //Inicializaci�n del tiempo actual +double t_ant=0; //Inicializacion del tiempo anterior const int total =30000; //double Vt[total]; //Vector de tiempos de eventos int k = 1; //Indice de los eventos ocurridos @@ -97,6 +98,7 @@ } // Se actualiza el vector de tiempos + t_ant=t; t=t+t_min; //Se actualiza el log de eventos //Vt[k]=t; @@ -154,14 +156,17 @@ //pc.printf("T_2: %.2f \r\n ",t_out2); //pc.printf("T_3: %.2f \r\n ",t_out3); // pc.printf("-------------- \r\n"); - suma1=suma1+C_Q1; - suma2=suma1+C_Q2; - suma3=suma1+C_Q3; + //suma1=suma1+C_Q1; + //suma2=suma1+C_Q2; + //suma3=suma1+C_Q3; + mean1=(mean1*t_ant+C_Q1*(t-t_ant))/t; + mean2=(mean2*t_ant+C_Q2*(t-t_ant))/t; + mean3=(mean3*t_ant+C_Q3*(t-t_ant))/t; } - mean1=suma1/total; - mean2=suma2/total; - mean3=suma3/total; - meanT = mean1+mean2+mean3; + + //mean2=suma2/total; + //mean3=suma3/total; + //meanT = mean1+mean2+mean3; pc.printf("Media Cola 1: %f \r\n",mean1); pc.printf("Media Cola 2: %f \r\n",mean2);