-
Notifications
You must be signed in to change notification settings - Fork 0
/
minimum_search.h
23 lines (22 loc) · 1.14 KB
/
minimum_search.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#pragma once
#include <utility>
#include <vector>
//results data
struct result {
int size; // size of @tmp and @trans
float * temp; // temperature
float * trans; // transmittance
};
// returns difference between ideal and current values (of temperature if @compateTemp, of transmittance otherwise
float difference(result ideal, result curr, bool compareTemp);
// returns true if current result's line lay below ideal's
bool isLessThanIdeal(result ideal, result current, bool compareTemp);
// searcjes for optimal value of parametr @params[@num]
// @timeTotal - total time in sec to model
// @outTime - array of time moments where @ideal.trans and @ideal.temp was measured
// @k - k0 and k1 - transmittance in the beginning and end
// @params - vector of changable parametres
// @deltas - vector of @params deltas - values to add or abstract from @params during search
// @ideal - experimental result
// @directlyProportional - true if parametr is directly proportional to function
void searchOptimalParam(int num, int timeTotal, int * outTime, std::pair<float, float> k, std::vector<float> ¶ms, std::vector<float> deltas, result ideal, bool directlyProportional);