use linear regression for preduction

This commit is contained in:
2024-12-26 18:49:04 +01:00
parent 29223c0070
commit 1564860213
3 changed files with 56 additions and 43 deletions

View File

@ -3,7 +3,6 @@
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define AVG10_SAMPLE_SIZE 10U
#define AVG60_SAMPLE_SIZE 60U
#define PRED10_SAMPLE_SIZE 10U
#define PRED60_SAMPLE_SIZE 60U
typedef enum _BurnerErrorState
@ -29,7 +28,7 @@ typedef struct _Average
typedef struct _Predict
{
float fValue;
float samples[MAX(PRED10_SAMPLE_SIZE, PRED60_SAMPLE_SIZE)];
float samples[PRED60_SAMPLE_SIZE];
size_t bufferIndex;
size_t bufferCount;
} sPredict;
@ -39,7 +38,6 @@ typedef struct _Measurement
float fCurrentValue;
sAverage average10s;
sAverage average60s;
sPredict predict10s;
sPredict predict60s;
eMeasurementErrorState state;
} sMeasurement;