Blame view

src/InternLib/Resampling.hh 29.3 KB
fbe3c2bb   Benjamin Renard   First commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/**
 * Resampling.hh
 *
 *  Created on: 31 oct. 2012
 *      Author: AKKA IS
 */

#ifndef Resampling_HH_
#define Resampling_HH_

#include <list>
#include "ParamData.hh"
#include "DataTypeMath.hh"
#include "VisitorOfParamData.hh"
#include "Operation.hh"

#include "TimeInterval.hh"

namespace AMDA {
namespace Parameters {

namespace Resampling {

ca31a786   Benjamin Renard   Fix other side ef...
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
class MarkerAbstract {
public:
	MarkerAbstract() : _startTime(0.), _stopTime(0.), _samplingTime(0.), _markerMinTime(0.), _markerMaxTime(0.), _targetTime(0.) {
	}

	virtual bool init(double pStartTime, double pStopTime, int /*currentTimeIntervalIndex*/, double pSamplingTime) {
		_startTime = pStartTime;
		_stopTime = pStopTime;
		_samplingTime = pSamplingTime;
		return true;
	}

	virtual bool nextTarget() = 0;

	double getTargetTime() {
		return _targetTime;
	}

	double getMarkerMinTime() {
		return _markerMinTime;
	}

	double getMarkerMaxTime() {
		return _markerMaxTime;
	}

	virtual bool isFinished() = 0;

protected:
	bool setTargetTime(double pTargetTime) {
		_targetTime = pTargetTime;
		_markerMinTime = _targetTime - _samplingTime / 2.;
		if (_markerMinTime < _startTime) {
			_markerMinTime = _startTime;
		}
		_markerMaxTime = _targetTime + _samplingTime / 2.;
		return !isFinished();
	}

	double _startTime;
	double _stopTime;
	double _samplingTime;
	double _markerMinTime;
        double _markerMaxTime;
	double _targetTime;
};

class MarkerRefParam: public MarkerAbstract {
public:
	MarkerRefParam() : MarkerAbstract(), _refParamDataPtr(NULL), _crtRefIndex(-1) {
	}

	void setRefParamData(ParamData* refParamDataPtr) {
		_refParamDataPtr = refParamDataPtr;
	}

	bool init(double pStartTime, double pStopTime, int currentTimeIntervalIndex, double pSamplingTime) {
		MarkerAbstract::init(pStartTime, pStopTime, currentTimeIntervalIndex, pSamplingTime);
		if (_refParamDataPtr == NULL) {
			return false;
		}
		if (_refParamDataPtr->getIndexInfo()._endTimeIntIndexList.empty() || (currentTimeIntervalIndex == 0)) {
			_crtRefIndex = 0;
		}
		else {
			std::list<unsigned int>::iterator it = _refParamDataPtr->getIndexInfo()._endTimeIntIndexList.begin();
			std::advance(it, currentTimeIntervalIndex-1);
			_crtRefIndex = *it;
		}
		while (pStartTime > _refParamDataPtr->getTime(_crtRefIndex)) {
			++_crtRefIndex;
			if (_crtRefIndex >= (int)_refParamDataPtr->getDataNumber()) {
				_crtRefIndex = -1;
				return false;
			}
		}
		return setTargetTime(_refParamDataPtr->getTime(_crtRefIndex));
	}

	bool nextTarget() {
		if (_crtRefIndex < 0) {
			return false;
		}
		if (_refParamDataPtr == NULL) {
			_crtRefIndex = -1;
			return false;
		}
		++_crtRefIndex;
		if (_crtRefIndex >= (int)_refParamDataPtr->getDataNumber()) {
			_crtRefIndex = -1;
			return false;
		}
		return setTargetTime(_refParamDataPtr->getTime(_crtRefIndex));
	}

	bool isFinished() {
		return (_crtRefIndex == -1);
	}

private:
	ParamData* _refParamDataPtr;

	int _crtRefIndex;
};

class MarkerSampling: public MarkerAbstract {
public:
	MarkerSampling() : MarkerAbstract() {
	}

	bool init(double pStartTime, double pStopTime, int currentTimeIntervalIndex, double pSamplingTime) {
		MarkerAbstract::init(pStartTime, pStopTime, currentTimeIntervalIndex, pSamplingTime);
		return setTargetTime(pStartTime);
	}

	bool nextTarget() {
		return setTargetTime(getTargetTime() + _samplingTime);
	}

	bool isFinished() {
		return (_targetTime < _startTime || _targetTime > _stopTime);
	}
};


fbe3c2bb   Benjamin Renard   First commit
149
150
151
152
153
154
155
156
/**
 * Define type Resampling.
 */
class ResamplingAbstract: public Operation {
public:
	/**
	 * @brief constructor
	 */
ca31a786   Benjamin Renard   Fix other side ef...
157
158
	ResamplingAbstract(Process& pProcess, bool pUseNearestValue) :
			Operation(pProcess), _isNewInt(true), _useNearestValue(pUseNearestValue) {
fbe3c2bb   Benjamin Renard   First commit
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176

	}
	/**
	 * @brief destructor.
	 */
	virtual ~ResamplingAbstract() {
	}
	/**
	 * @brief compute static data
	 */
	virtual void init() = 0;

	/**
	 * @overload Operation::reset(double pStartTime, double pTimeInt)
	 * @brief reset static data to process another TimeInterval
	 */
	virtual void reset() {
		Operation::reset();
a6490f4d   Benjamin Renard   Do not throw an e...
177
		resetResampling();
fbe3c2bb   Benjamin Renard   First commit
178
179
180
181
182
183
184
185
		_isNewInt = true;
	}

	/*
	 * @brief return sampling value
	 */
	virtual double getSampling() = 0;

a6490f4d   Benjamin Renard   Do not throw an e...
186
187
188
189
190
	/*
	 * @brief reset resampling
	 */
	virtual void resetResampling() = 0;

fbe3c2bb   Benjamin Renard   First commit
191
protected:
fbe3c2bb   Benjamin Renard   First commit
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
	/**
	 *@brief  tag to know if a new time interval is set
	 */
	bool _isNewInt;

	/*
	 * @brief  Define the resampling strategy
	 */
	bool _useNearestValue;
};

/**
 * Simple Resampling abstract class, depand of paramData type
 */
template<typename TParamData>
class ResamplingSimpleAbstract: public ResamplingAbstract {

public:
	/**
	 * @brief  Element type of paramData
	 */
	typedef typename TParamData::ElementType ElementType;

	/**
	 * @brief  Constructor
	 */
ca31a786   Benjamin Renard   Fix other side ef...
218
219
220
221
222
	ResamplingSimpleAbstract(Process& pProcess, MarkerAbstract* pMarkerPtr, TimeIntervalListSPtr pTimeIntervalList, double gapSize, TParamData &param, bool pUseNearestValue) :
			ResamplingAbstract(pProcess, pUseNearestValue),
					_markerPtr(pMarkerPtr),
					_timeIntervalList(pTimeIntervalList),
					_currentTimeInterval(_timeIntervalList->begin()), _currentTimeIntervalIndex(0), _samplingMode(INTERPOLATION), _nearestTime(NAN), _lastTime(0),
fbe3c2bb   Benjamin Renard   First commit
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
					_leftEffect(true), _paramOutput(new TParamData()), _paramInput(param),
					_gapSize(gapSize) {
		_paramDataOutput = _paramOutput;
	}

	/**
	 * @brief  Destructor
	 */
	virtual ~ResamplingSimpleAbstract() {
	}
	;

	/**
	 * @brief Type List of Element type of paramData
	 */
	typedef std::list<ElementType> ListValue;

	/**
	 * @overload ResamplingAbstract::ResamplingAbstract::write()
	 */
	void write(ParamDataIndexInfo &pParamDataIndexInfo) {
		if (_isNewInt)
		{
ca31a786   Benjamin Renard   Fix other side ef...
246
			_markerPtr->init((*_currentTimeInterval)._startTime, (*_currentTimeInterval)._stopTime, _currentTimeIntervalIndex, getSampling());
fbe3c2bb   Benjamin Renard   First commit
247
248
249
250
251
			_isNewInt = false;
		}

		if ((pParamDataIndexInfo._nbDataToProcess > 0)) {
			//init _val with the first data value (to init dimensions)
65aa1ad5   Benjamin Renard   Fix a bug in resa...
252
253
254
255
256
257
258
			if (pParamDataIndexInfo._startIndex == 0)
			{
				_val = _paramInput.get(pParamDataIndexInfo._startIndex);
				_nearestValue = _paramInput.get(pParamDataIndexInfo._startIndex);
				_val << NotANumber();
				_nearestValue << NotANumber();
			}
fbe3c2bb   Benjamin Renard   First commit
259
260
261
262
263

			switch (_samplingMode)
			{
			case AVERAGE :
				writeAverage(pParamDataIndexInfo);
fbe3c2bb   Benjamin Renard   First commit
264
265
266
267
268
269
270
271
				break;
			case NEARESTVALUE :
				writeNearestValue(pParamDataIndexInfo);
				break;
			case INTERPOLATION :
				writeInterpolation(pParamDataIndexInfo);
				break;
			}
ca31a786   Benjamin Renard   Fix other side ef...
272
		}
bb672c4c   Benjamin Renard   Fix side effect i...
273
		if (pParamDataIndexInfo._timeIntToProcessChanged || pParamDataIndexInfo._noMoreTimeInt) {
fbe3c2bb   Benjamin Renard   First commit
274
275
276
277
278
279
280
281
			terminated();
		}
	}

	/**
	 * @brief compute and write last value, right effect
	 */
	virtual void terminated() {
ca31a786   Benjamin Renard   Fix other side ef...
282
		if (_markerPtr->isFinished()) {
bb672c4c   Benjamin Renard   Fix side effect i...
283
284
			return;
		}
fbe3c2bb   Benjamin Renard   First commit
285
286
		switch (_samplingMode)
		{
fbe3c2bb   Benjamin Renard   First commit
287
		case AVERAGE :
a40aa278   Benjamin Renard   Fix resampling
288
289
290
291
292
293
294
			do {
				if (!_mem.empty()) {
					_val = average(_mem,_paramInput.getDim1(),_paramInput.getDim2());
				}
				else {
					_val << NotANumber();
				}
fbe3c2bb   Benjamin Renard   First commit
295
				_paramOutput->push(_val);
ca31a786   Benjamin Renard   Fix other side ef...
296
				_paramDataOutput->pushTime(_markerPtr->getTargetTime());
fbe3c2bb   Benjamin Renard   First commit
297
				_mem.clear();
a40aa278   Benjamin Renard   Fix resampling
298
			} while(_markerPtr->nextTarget());
fbe3c2bb   Benjamin Renard   First commit
299
			break;
2f932bad   Benjamin Renard   Fix interpolation...
300
		case INTERPOLATION :
fbe3c2bb   Benjamin Renard   First commit
301
		case NEARESTVALUE :
bb672c4c   Benjamin Renard   Fix side effect i...
302
			//Fix  side-off effects - Right boundary - CONSTANTS
ca31a786   Benjamin Renard   Fix other side ef...
303
304
305
306
307
308
309
310
311
			do {
				if ((_markerPtr->getTargetTime() - _lastTime) <= _gapSize)
					_val = _valMoins1;
				else
					_val << NotANumber();
				_paramOutput->pushTime(_markerPtr->getTargetTime());
				_paramOutput->push(_val);
			
			} while(_markerPtr->nextTarget());
bb672c4c   Benjamin Renard   Fix side effect i...
312
			break;
2f932bad   Benjamin Renard   Fix interpolation...
313
		}
fbe3c2bb   Benjamin Renard   First commit
314
315
316
317
318
319
320
321
322
323
324
325
326
	}

	/**
	 * @brief compute and write new value in average mode
	 */
	void writeNearestValue(ParamDataIndexInfo &pParamDataIndexInfo)
	{
		for (unsigned int index = pParamDataIndexInfo._startIndex;
				index < pParamDataIndexInfo._startIndex
					+ pParamDataIndexInfo._nbDataToProcess; index++)
		{
			double timeCurrent = _paramInput.getTime(index);

ca31a786   Benjamin Renard   Fix other side ef...
327
			if (timeCurrent < _markerPtr->getMarkerMaxTime())
fbe3c2bb   Benjamin Renard   First commit
328
			{
ca31a786   Benjamin Renard   Fix other side ef...
329
330
331
				if (timeCurrent < _markerPtr->getMarkerMinTime()) {
					continue;
				}
fbe3c2bb   Benjamin Renard   First commit
332
333
334
335
336
				if (isNAN(_nearestTime))
				{
					_nearestValue = _paramInput.get(index);
					_nearestTime = timeCurrent;
				}
ca31a786   Benjamin Renard   Fix other side ef...
337
				else if (abs(_nearestTime-_markerPtr->getTargetTime()) > abs(timeCurrent-_markerPtr->getTargetTime()))
fbe3c2bb   Benjamin Renard   First commit
338
339
340
341
342
343
				{
					_nearestValue = _paramInput.get(index);
					_nearestTime = timeCurrent;
				}
			} else {
				_paramOutput->push(_nearestValue);
ca31a786   Benjamin Renard   Fix other side ef...
344
345
				_paramDataOutput->pushTime(_markerPtr->getTargetTime());
				if(!_markerPtr->nextTarget())
fbe3c2bb   Benjamin Renard   First commit
346
					break;
ca31a786   Benjamin Renard   Fix other side ef...
347
				while (_markerPtr->getMarkerMaxTime() < timeCurrent)
fbe3c2bb   Benjamin Renard   First commit
348
				{
2f932bad   Benjamin Renard   Fix interpolation...
349
					if (timeCurrent - _lastTime < _gapSize) {
80265e6a   Benjamin Renard   Compute interpola...
350
						//Interpolation
ca31a786   Benjamin Renard   Fix other side ef...
351
						double coefT = (float) (_markerPtr->getTargetTime() - _lastTime) / (timeCurrent - _lastTime);
2f932bad   Benjamin Renard   Fix interpolation...
352
						_val = interpolation(_valMoins1, _paramInput.get(index), coefT, _paramInput.getDim1(),_paramInput.getDim2());
80265e6a   Benjamin Renard   Compute interpola...
353
					}
2f932bad   Benjamin Renard   Fix interpolation...
354
					else {
80265e6a   Benjamin Renard   Compute interpola...
355
						_val << NotANumber();
2f932bad   Benjamin Renard   Fix interpolation...
356
					}
fbe3c2bb   Benjamin Renard   First commit
357
					_paramOutput->push(_val);
ca31a786   Benjamin Renard   Fix other side ef...
358
					_paramDataOutput->pushTime(_markerPtr->getTargetTime());
fbe3c2bb   Benjamin Renard   First commit
359
					_nearestTime << NotANumber();
ca31a786   Benjamin Renard   Fix other side ef...
360
					if(!_markerPtr->nextTarget())
fbe3c2bb   Benjamin Renard   First commit
361
						break;
fbe3c2bb   Benjamin Renard   First commit
362
				}
fbe3c2bb   Benjamin Renard   First commit
363
364
365
				_nearestValue = _paramInput.get(index);
				_nearestTime = timeCurrent;
			}
80265e6a   Benjamin Renard   Compute interpola...
366
367
368

			_lastTime = _paramInput.getTime(index);
			_valMoins1 = _paramInput.get(index);
fbe3c2bb   Benjamin Renard   First commit
369
370
371
372
373
374
375
		}
	}

	/**
	 * @brief compute and write new value in average mode
	 */
	void writeAverage(ParamDataIndexInfo &pParamDataIndexInfo) {
fbe3c2bb   Benjamin Renard   First commit
376
377
378
379
380
381
382
383
		for (unsigned int index = pParamDataIndexInfo._startIndex;
				index
						< pParamDataIndexInfo._startIndex
								+ pParamDataIndexInfo._nbDataToProcess;
				index++) {

			double timeCurrent = _paramInput.getTime(index);

ca31a786   Benjamin Renard   Fix other side ef...
384
385
386
387
			if (timeCurrent < _markerPtr->getMarkerMaxTime()) {
				if (timeCurrent >= _markerPtr->getMarkerMinTime()) { 
					_mem.push_back(_paramInput.get(index));
				}
fbe3c2bb   Benjamin Renard   First commit
388
			} else {
ca31a786   Benjamin Renard   Fix other side ef...
389
				if (!_mem.empty()) {
c6877b6f   Benjamin Renard   Fix average for v...
390
					_val = average(_mem,_paramInput.getDim1(),_paramInput.getDim2());
ca31a786   Benjamin Renard   Fix other side ef...
391
				}
2f932bad   Benjamin Renard   Fix interpolation...
392
				else if (timeCurrent - _lastTime < _gapSize) {
80265e6a   Benjamin Renard   Compute interpola...
393
					//Interpolation
ca31a786   Benjamin Renard   Fix other side ef...
394
					double coefT = (float) (_markerPtr->getTargetTime() - _lastTime) / (timeCurrent - _lastTime);
2f932bad   Benjamin Renard   Fix interpolation...
395
					_val = interpolation(_valMoins1, _paramInput.get(index), coefT, _paramInput.getDim1(),_paramInput.getDim2());
80265e6a   Benjamin Renard   Compute interpola...
396
				}
ca31a786   Benjamin Renard   Fix other side ef...
397
				else {
fbe3c2bb   Benjamin Renard   First commit
398
					_val << NotANumber();
ca31a786   Benjamin Renard   Fix other side ef...
399
				}
fbe3c2bb   Benjamin Renard   First commit
400
				_paramOutput->push(_val);
ca31a786   Benjamin Renard   Fix other side ef...
401
402
				_paramDataOutput->pushTime(_markerPtr->getTargetTime());
				_mem.clear();
fbe3c2bb   Benjamin Renard   First commit
403

ca31a786   Benjamin Renard   Fix other side ef...
404
				if(!_markerPtr->nextTarget())
fbe3c2bb   Benjamin Renard   First commit
405
					break;
fbe3c2bb   Benjamin Renard   First commit
406

ca31a786   Benjamin Renard   Fix other side ef...
407
				while (_markerPtr->getMarkerMaxTime() < timeCurrent)
fbe3c2bb   Benjamin Renard   First commit
408
				{
2f932bad   Benjamin Renard   Fix interpolation...
409
					if (timeCurrent - _lastTime < _gapSize) {
80265e6a   Benjamin Renard   Compute interpola...
410
						//Interpolation
ca31a786   Benjamin Renard   Fix other side ef...
411
						double coefT = (float) (_markerPtr->getTargetTime() - _lastTime) / (timeCurrent - _lastTime);
2f932bad   Benjamin Renard   Fix interpolation...
412
						_val = interpolation(_valMoins1, _paramInput.get(index), coefT, _paramInput.getDim1(),_paramInput.getDim2());
80265e6a   Benjamin Renard   Compute interpola...
413
414
415
					}
					else
						_val << NotANumber();
fbe3c2bb   Benjamin Renard   First commit
416
					_paramOutput->push(_val);
ca31a786   Benjamin Renard   Fix other side ef...
417
418
					_paramDataOutput->pushTime(_markerPtr->getTargetTime());
					if(!_markerPtr->nextTarget())
fbe3c2bb   Benjamin Renard   First commit
419
						break;
fbe3c2bb   Benjamin Renard   First commit
420
				}
ca31a786   Benjamin Renard   Fix other side ef...
421
422
423
				if ((timeCurrent >= _markerPtr->getMarkerMinTime()) && (timeCurrent < _markerPtr->getMarkerMaxTime())) {
					_mem.push_back(_paramInput.get(index));
				}
fbe3c2bb   Benjamin Renard   First commit
424
			}
80265e6a   Benjamin Renard   Compute interpola...
425
426
			_lastTime = _paramInput.getTime(index);
			_valMoins1 = _paramInput.get(index);
fbe3c2bb   Benjamin Renard   First commit
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
		}
	}

	/**
	 * @brief compute and write new value in interpolation mode
	 */
	void writeInterpolation(ParamDataIndexInfo &pParamDataIndexInfo) {
		for (unsigned int index = pParamDataIndexInfo._startIndex;
				index
						< pParamDataIndexInfo._startIndex
								+ pParamDataIndexInfo._nbDataToProcess;
				index++) {

			double timeCurrent = _paramInput.getTime(index);

fbe3c2bb   Benjamin Renard   First commit
442
443
			//Fix  side-off effects - Left boundary - CONSTANTS
			if (_leftEffect) {
ca31a786   Benjamin Renard   Fix other side ef...
444
445
				while (_markerPtr->getTargetTime() <= timeCurrent) {
					if (abs(timeCurrent - _markerPtr->getTargetTime()) <= _gapSize) {
fbe3c2bb   Benjamin Renard   First commit
446
447
448
449
						_val = _paramInput.get(index);
					} else {
						_val << NotANumber();
					}
ca31a786   Benjamin Renard   Fix other side ef...
450
					_paramDataOutput->pushTime(_markerPtr->getTargetTime());
fbe3c2bb   Benjamin Renard   First commit
451
					_paramOutput->push(_val);
ca31a786   Benjamin Renard   Fix other side ef...
452
					if (!_markerPtr->nextTarget())
fbe3c2bb   Benjamin Renard   First commit
453
454
455
456
						break;
				}
				_leftEffect = false;
			} else {
ca31a786   Benjamin Renard   Fix other side ef...
457
458
				if (_markerPtr->getTargetTime() <= timeCurrent) {
					while (_markerPtr->getTargetTime() <= timeCurrent) {
fbe3c2bb   Benjamin Renard   First commit
459
460
						double deltaT = (float) (timeCurrent - _lastTime);
						if (deltaT <= _gapSize) {
ca31a786   Benjamin Renard   Fix other side ef...
461
							double coefT = (float) (_markerPtr->getTargetTime() - _lastTime) / deltaT;
2f932bad   Benjamin Renard   Fix interpolation...
462
							_val = interpolation(_valMoins1, _paramInput.get(index), coefT, _paramInput.getDim1(),_paramInput.getDim2());
fbe3c2bb   Benjamin Renard   First commit
463
464
465
						} else {
							_val << NotANumber();
						}
ca31a786   Benjamin Renard   Fix other side ef...
466
						_paramDataOutput->pushTime(_markerPtr->getTargetTime());
fbe3c2bb   Benjamin Renard   First commit
467
						_paramOutput->push(_val);
ca31a786   Benjamin Renard   Fix other side ef...
468
						if (!_markerPtr->nextTarget())
fbe3c2bb   Benjamin Renard   First commit
469
470
471
472
							break;
					}
				}
			}
fbe3c2bb   Benjamin Renard   First commit
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
			_lastTime = _paramInput.getTime(index);
			_valMoins1 = _paramInput.get(index);
		}
	}

	/**
	 * @overload ResamplingAbstract::ResamplingAbstract::init()
	 */
	virtual void init() {
		//Compute Sampling mode
		if (_useNearestValue)
		{
			_samplingMode = NEARESTVALUE;
			_nearestValue = ElementType();
			_nearestTime << NotANumber();
		}
		else
		{
			float minSampling = _paramInput.getMinSampling();

			if ((minSampling * 2) < getSampling()) {
				_samplingMode = AVERAGE;
			}
		}

		_isNewInt = true;
	}

	/**
	 * @overload ResamplingAbstract::reset(double pStartTime, double pTimeInt)
	 */
a6490f4d   Benjamin Renard   Do not throw an e...
504
	virtual void resetResampling() {
fbe3c2bb   Benjamin Renard   First commit
505
506
507
		if (_currentTimeInterval == _timeIntervalList->end())
			return;

fbe3c2bb   Benjamin Renard   First commit
508
509
		// Get next TimeInteval;
		++_currentTimeInterval;
ca31a786   Benjamin Renard   Fix other side ef...
510
		++_currentTimeIntervalIndex;
fbe3c2bb   Benjamin Renard   First commit
511
512
513
		_samplingMode = INTERPOLATION;
		_lastTime = 0;
		_leftEffect = true;
599e1446   Benjamin Renard   Fix new interval ...
514
515
		_valMoins1 << NotANumber();
		_val<< NotANumber();
fbe3c2bb   Benjamin Renard   First commit
516
517
518
519
520
		_mem.clear();

		init();
	}

ca31a786   Benjamin Renard   Fix other side ef...
521
	virtual double getSampling() = 0;
fbe3c2bb   Benjamin Renard   First commit
522
523
524
525
526
527
528
529

	/**
	 * @brief sampling mode
	 */
	enum SamplingMode {
		INTERPOLATION, AVERAGE, NEARESTVALUE
	};

fbe3c2bb   Benjamin Renard   First commit
530
531
532
533
534
535
536
private:

	/**
	 * @brief stored val to compute average in average mode
	 */
	ListValue _mem;

ca31a786   Benjamin Renard   Fix other side ef...
537
538
	MarkerAbstract* _markerPtr;
	
fbe3c2bb   Benjamin Renard   First commit
539
540
541
542
	TimeIntervalListSPtr _timeIntervalList;

	TimeIntervalList::iterator _currentTimeInterval;

ca31a786   Benjamin Renard   Fix other side ef...
543
	int _currentTimeIntervalIndex;
fbe3c2bb   Benjamin Renard   First commit
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592

	/**<
	 * @brief current sampling mode
	 */
	SamplingMode _samplingMode;

	/**<
	 * @brief last computed value
	 */
	ElementType _val;

	/**
	 * @brief nearest time
	 */
	double _nearestTime;

	/**
	 * @brief nearest value
	 */
	ElementType _nearestValue;

	/**<
	 * @brief last input value
	 */
	ElementType _valMoins1;
	/**<
	 * @brief time of  last input value
	 */
	double _lastTime;

	/**
	 * @brief left effect indicator in interpolation mode
	 */
	bool _leftEffect;

	/**
	 * @brief real ParamData Output
	 */
	TParamData *_paramOutput;

	/**
	 * @brief real ParamData Input
	 */
	TParamData& _paramInput;

	/**
	 * @brief gap size for input data
	 */
	double _gapSize;
fbe3c2bb   Benjamin Renard   First commit
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
}
;

/**
 * Resampling implementation with a given sampling time , depand of paramData type
 */
template<typename TParamData>
class ResamplingWithSamplingTime : public ResamplingSimpleAbstract<TParamData> {

public:
	/**
	 * @brief  Constructor
	 */
	ResamplingWithSamplingTime(Process& pProcess, TimeIntervalListSPtr pTimeIntervalList,
			double sampling, double gapSize, TParamData &param, bool  pUseNearestValue) :
ca31a786   Benjamin Renard   Fix other side ef...
608
609
			ResamplingSimpleAbstract<TParamData>(pProcess, &_marker, pTimeIntervalList,
						gapSize, param, pUseNearestValue), _samplingTime(sampling) {
fbe3c2bb   Benjamin Renard   First commit
610
611
612
613
614
615
616
617
	}

	/**
	 * @brief  Destructor
	 */
	virtual ~ResamplingWithSamplingTime() {
	}

ca31a786   Benjamin Renard   Fix other side ef...
618
619
	double getSampling() {
		return _samplingTime;
fbe3c2bb   Benjamin Renard   First commit
620
621
622
	}

private:
ca31a786   Benjamin Renard   Fix other side ef...
623
624
625
626
	MarkerSampling _marker;

	double _samplingTime;
};
fbe3c2bb   Benjamin Renard   First commit
627
628
629
630
631
632
633
634
635
636
637
638
639
640


/**
 * Resampling implementation with a given reference parameter for time definition , depand of paramData type
 */
template<typename TParamData>
class ResamplingWithRefParam: public ResamplingSimpleAbstract<TParamData> {

public:
	/**
	 * @brief  Constructor
	 */
	ResamplingWithRefParam(Process& pProcess, TimeIntervalListSPtr pTimeIntervalList,
			TParamData &param, ParamData &refParamData, double gapSize, bool  pUseNearestValue) :
ca31a786   Benjamin Renard   Fix other side ef...
641
642
643
			ResamplingSimpleAbstract<TParamData>(pProcess, &_marker, pTimeIntervalList,
					gapSize, param, pUseNearestValue), _refParamData(refParamData) {
		_marker.setRefParamData(&refParamData);
fbe3c2bb   Benjamin Renard   First commit
644
645
646
647
648
649
650
651
	}

	/**
	 * @brief  Destructor
	 */
	virtual ~ResamplingWithRefParam() {
	}

ca31a786   Benjamin Renard   Fix other side ef...
652
	double getSampling() {
fbe3c2bb   Benjamin Renard   First commit
653
		return _refParamData.getMinSampling();
ca31a786   Benjamin Renard   Fix other side ef...
654
        }
fbe3c2bb   Benjamin Renard   First commit
655
656

private:
ca31a786   Benjamin Renard   Fix other side ef...
657
	MarkerRefParam _marker;
fbe3c2bb   Benjamin Renard   First commit
658

fbe3c2bb   Benjamin Renard   First commit
659
	ParamData& _refParamData;
ca31a786   Benjamin Renard   Fix other side ef...
660
};
fbe3c2bb   Benjamin Renard   First commit
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804

/**
 * create the real Resampling implementation with visitor design pattern
 */
class CreateResampling: public VisitorOfParamData {
public:
	enum ResamplingType {
		RT_WITHSAMPLINGTIME,
		RT_WITHREFTIMELIST
	};

	/**
	 * @brief constructor
	 */
	CreateResampling(Process& pProcess, TimeIntervalListSPtr pTimeIntervalList,
			double sampling, double gapSize, ParamData &paramData, bool useNearestValue) :
			_type(ResamplingType::RT_WITHSAMPLINGTIME),
			_process(pProcess), _paramData(paramData), _resampling(NULL), _timeIntervalList(
					pTimeIntervalList), _sampling(sampling), _gapSize(
					gapSize), _refParamData(paramData), _useNearestValue(useNearestValue) {
		_paramData.accept(*this);
	}

	/**
	 * @brief constructor
	 */
	CreateResampling(Process& pProcess, TimeIntervalListSPtr pTimeIntervalList,
			ParamData &paramData, ParamData& refParamData, double gapSize, bool useNearestValue) :
			_type(ResamplingType::RT_WITHREFTIMELIST),
			_process(pProcess), _paramData(paramData), _resampling(NULL), _timeIntervalList(
					pTimeIntervalList), _sampling(0.), _gapSize(
					gapSize),_refParamData(refParamData), _useNearestValue(useNearestValue) {
		_paramData.accept(*this);
	}

	/**
	 * @overload VisitorOfParamData::visit(ParamDataScalaireShort *)
	 */
	virtual void visit(ParamDataScalaireShort *) {
		switch (_type)
		{
		case ResamplingType::RT_WITHSAMPLINGTIME :
			_resampling = new ResamplingWithSamplingTime<ParamDataScalaireShort>(_process,
					_timeIntervalList, _sampling, _gapSize,
					dynamic_cast<ParamDataScalaireShort &>(_paramData), _useNearestValue);
			break;
		case ResamplingType::RT_WITHREFTIMELIST :
			_resampling = new ResamplingWithRefParam<ParamDataScalaireShort>(_process,
				_timeIntervalList,
				dynamic_cast<ParamDataScalaireShort &>(_paramData),
				_refParamData,
				_gapSize, _useNearestValue);
			break;
		}
	}

	/**
	 * @overload VisitorOfParamData::visit(ParamDataScalaireFloat *)
	 */
	virtual void visit(ParamDataScalaireFloat *) {
		switch (_type)
		{
		case ResamplingType::RT_WITHSAMPLINGTIME :
			_resampling = new ResamplingWithSamplingTime<ParamDataScalaireFloat>(_process,
							_timeIntervalList, _sampling, _gapSize,
							dynamic_cast<ParamDataScalaireFloat &>(_paramData), _useNearestValue);
			break;
		case ResamplingType::RT_WITHREFTIMELIST :
			_resampling = new ResamplingWithRefParam<ParamDataScalaireFloat>(_process,
							_timeIntervalList,
							dynamic_cast<ParamDataScalaireFloat &>(_paramData),
							_refParamData,
							_gapSize, _useNearestValue);
			break;
		}
	}

	/**
	 * @overload VisitorOfParamData::visit(ParamDataScalaireDouble *)
	 */
	virtual void visit(ParamDataScalaireDouble *) {
		switch (_type)
		{
		case ResamplingType::RT_WITHSAMPLINGTIME :
			_resampling = new ResamplingWithSamplingTime<ParamDataScalaireDouble>(_process,
				_timeIntervalList, _sampling, _gapSize,
				dynamic_cast<ParamDataScalaireDouble &>(_paramData), _useNearestValue);
			break;
		case ResamplingType::RT_WITHREFTIMELIST :
			_resampling = new ResamplingWithRefParam<ParamDataScalaireDouble>(_process,
				_timeIntervalList,
				dynamic_cast<ParamDataScalaireDouble &>(_paramData),
				_refParamData,
				_gapSize, _useNearestValue);
			break;
		}
	}

	/**
	 * @overload VisitorOfParamData::visit(ParamDataScalaireLongDouble *)
	 */
	virtual void visit(ParamDataScalaireLongDouble *) {
		switch (_type)
		{
		case ResamplingType::RT_WITHSAMPLINGTIME :
			_resampling = new ResamplingWithSamplingTime<ParamDataScalaireLongDouble>(_process,
				_timeIntervalList, _sampling, _gapSize,
				dynamic_cast<ParamDataScalaireLongDouble &>(_paramData), _useNearestValue);
			break;
		case ResamplingType::RT_WITHREFTIMELIST :
			_resampling = new ResamplingWithRefParam<ParamDataScalaireLongDouble>(_process,
				_timeIntervalList,
				dynamic_cast<ParamDataScalaireLongDouble &>(_paramData),
				_refParamData,
				_gapSize, _useNearestValue);
			break;
		}
	}

	/**
	 * @overload VisitorOfParamData::visit(ParamDataScalaireInt *)
	 */
	virtual void visit(ParamDataScalaireInt *) {
		switch (_type)
		{
		case ResamplingType::RT_WITHSAMPLINGTIME :
			_resampling = new ResamplingWithSamplingTime<ParamDataScalaireInt>(_process,
					_timeIntervalList, _sampling, _gapSize,
					dynamic_cast<ParamDataScalaireInt &>(_paramData), _useNearestValue);
			break;
		case ResamplingType::RT_WITHREFTIMELIST :
			_resampling = new ResamplingWithRefParam<ParamDataScalaireInt>(_process,
				_timeIntervalList,
				dynamic_cast<ParamDataScalaireInt &>(_paramData),
				_refParamData,
				_gapSize, _useNearestValue);
			break;
		}
	}

	/**
	 * @overload VisitorOfParamData::visit(ParamDataLogicalData *)
	 */
	virtual void visit(ParamDataLogicalData *) {
7578a549   Benjamin Renard   Add boolean suppo...
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
		switch (_type)
		{
		case ResamplingType::RT_WITHSAMPLINGTIME :
			// !! Force the use of the nearest value
			_resampling = new ResamplingWithSamplingTime<ParamDataLogicalData>(_process,
					_timeIntervalList, _sampling, _gapSize,
					dynamic_cast<ParamDataLogicalData &>(_paramData), true);
			break;
		case ResamplingType::RT_WITHREFTIMELIST :
			// !! Force the use of the nearest value
			_resampling = new ResamplingWithRefParam<ParamDataLogicalData>(_process,
				_timeIntervalList,
				dynamic_cast<ParamDataLogicalData &>(_paramData),
				_refParamData,
				_gapSize, true);
			break;
		}
fbe3c2bb   Benjamin Renard   First commit
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
	}

	/**
	 * @overload VisitorOfParamData::visit(ParamDataTab1DShort *)
	 */
	virtual void visit(ParamDataTab1DShort *) {
		switch (_type)
		{
		case ResamplingType::RT_WITHSAMPLINGTIME :
			_resampling = new ResamplingWithSamplingTime<ParamDataTab1DShort>(_process,
				_timeIntervalList, _sampling, _gapSize,
				dynamic_cast<ParamDataTab1DShort &>(_paramData), _useNearestValue);
			break;
		case ResamplingType::RT_WITHREFTIMELIST :
			_resampling = new ResamplingWithRefParam<ParamDataTab1DShort>(_process,
				_timeIntervalList,
				dynamic_cast<ParamDataTab1DShort &>(_paramData),
				_refParamData,
				_gapSize, _useNearestValue);
			break;
		}
	}

	/**
	 * @overload VisitorOfParamData::visit(ParamDataTab1DFloat *)
	 */
	virtual void visit(ParamDataTab1DFloat *) {
		switch (_type)
		{
		case ResamplingType::RT_WITHSAMPLINGTIME :
			_resampling = new ResamplingWithSamplingTime<ParamDataTab1DFloat>(_process,
				_timeIntervalList, _sampling, _gapSize,
				dynamic_cast<ParamDataTab1DFloat &>(_paramData), _useNearestValue);
			break;
		case ResamplingType::RT_WITHREFTIMELIST :
			_resampling = new ResamplingWithRefParam<ParamDataTab1DFloat>(_process,
				_timeIntervalList,
				dynamic_cast<ParamDataTab1DFloat &>(_paramData),
				_refParamData,
				_gapSize, _useNearestValue);
			break;
		}
	}

	/**
	 * @overload VisitorOfParamData::visit(ParamDataTab1DDouble *)
	 */
	virtual void visit(ParamDataTab1DDouble *) {
		switch (_type)
		{
		case ResamplingType::RT_WITHSAMPLINGTIME :
			_resampling = new ResamplingWithSamplingTime<ParamDataTab1DDouble>(_process,
				_timeIntervalList, _sampling, _gapSize,
				dynamic_cast<ParamDataTab1DDouble &>(_paramData), _useNearestValue);
			break;
		case ResamplingType::RT_WITHREFTIMELIST :
			_resampling = new ResamplingWithRefParam<ParamDataTab1DDouble>(_process,
				_timeIntervalList,
				dynamic_cast<ParamDataTab1DDouble &>(_paramData),
				_refParamData,
				_gapSize, _useNearestValue);
			break;
		}
	}

	/**
	 * @overload VisitorOfParamData::visit(ParamDataTab1DLongDouble *)
	 */
	virtual void visit(ParamDataTab1DLongDouble *) {
		switch (_type)
		{
		case ResamplingType::RT_WITHSAMPLINGTIME :
			_resampling = new ResamplingWithSamplingTime<ParamDataTab1DLongDouble>(_process,
				_timeIntervalList, _sampling, _gapSize,
				dynamic_cast<ParamDataTab1DLongDouble &>(_paramData), _useNearestValue);
			break;
		case ResamplingType::RT_WITHREFTIMELIST :
			_resampling = new ResamplingWithRefParam<ParamDataTab1DLongDouble>(_process,
				_timeIntervalList,
				dynamic_cast<ParamDataTab1DLongDouble &>(_paramData),
				_refParamData,
				_gapSize, _useNearestValue);
			break;
		}
	}

	/**
	 * @overload VisitorOfParamData::visit(ParamDataTab1DInt *)
	 */
	virtual void visit(ParamDataTab1DInt *) {
		switch (_type)
		{
		case ResamplingType::RT_WITHSAMPLINGTIME :
			_resampling = new ResamplingWithSamplingTime<ParamDataTab1DInt>(_process,
				_timeIntervalList, _sampling, _gapSize,
				dynamic_cast<ParamDataTab1DInt &>(_paramData), _useNearestValue);
			break;
		case ResamplingType::RT_WITHREFTIMELIST :
			_resampling = new ResamplingWithRefParam<ParamDataTab1DInt>(_process,
				_timeIntervalList,
				dynamic_cast<ParamDataTab1DInt &>(_paramData),
				_refParamData,
				_gapSize, _useNearestValue);
			break;
		}
	}

	/**
	 * @overload VisitorOfParamData::visit(ParamDataTab1DLogicalData *)
	 */
	virtual void visit(ParamDataTab1DLogicalData *) {
7578a549   Benjamin Renard   Add boolean suppo...
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
		switch (_type)
		{
		case ResamplingType::RT_WITHSAMPLINGTIME :
			// !! Force the use of the nearest value
			_resampling = new ResamplingWithSamplingTime<ParamDataTab1DLogicalData>(_process,
				_timeIntervalList, _sampling, _gapSize,
				dynamic_cast<ParamDataTab1DLogicalData &>(_paramData), true);
			break;
		case ResamplingType::RT_WITHREFTIMELIST :
			// !! Force the use of the nearest value
			_resampling = new ResamplingWithRefParam<ParamDataTab1DLogicalData>(_process,
				_timeIntervalList,
				dynamic_cast<ParamDataTab1DLogicalData &>(_paramData),
				_refParamData,
				_gapSize, true);
			break;
		}
fbe3c2bb   Benjamin Renard   First commit
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
	}

	/**
	 * @overload VisitorOfParamData::visit(ParamDataTab2DShort *)
	 */
	virtual void visit(ParamDataTab2DShort *) {
		switch (_type)
		{
		case ResamplingType::RT_WITHSAMPLINGTIME :
			_resampling = new ResamplingWithSamplingTime<ParamDataTab2DShort>(_process,
					_timeIntervalList, _sampling, _gapSize,
					dynamic_cast<ParamDataTab2DShort &>(_paramData), _useNearestValue);
			break;
		case ResamplingType::RT_WITHREFTIMELIST :
			_resampling = new ResamplingWithRefParam<ParamDataTab2DShort>(_process,
				_timeIntervalList,
				dynamic_cast<ParamDataTab2DShort &>(_paramData),
				_refParamData,
				_gapSize, _useNearestValue);
			break;
		}
	}

	/**
	 * @overload VisitorOfParamData::visit(ParamDataTab2DFloat *)
	 */
	virtual void visit(ParamDataTab2DFloat *) {
		switch (_type)
		{
		case ResamplingType::RT_WITHSAMPLINGTIME :
			_resampling = new ResamplingWithSamplingTime<ParamDataTab2DFloat>(_process,
					_timeIntervalList, _sampling, _gapSize,
					dynamic_cast<ParamDataTab2DFloat &>(_paramData), _useNearestValue);
			break;
		case ResamplingType::RT_WITHREFTIMELIST :
			_resampling = new ResamplingWithRefParam<ParamDataTab2DFloat>(_process,
				_timeIntervalList,
				dynamic_cast<ParamDataTab2DFloat &>(_paramData),
				_refParamData,
				_gapSize, _useNearestValue);
			break;
		}
	}

	/**
	 * @overload VisitorOfParamData::visit(ParamDataTab2DDouble *)
	 */
	virtual void visit(ParamDataTab2DDouble *) {
		switch (_type)
		{
		case ResamplingType::RT_WITHSAMPLINGTIME :
			_resampling = new ResamplingWithSamplingTime<ParamDataTab2DDouble>(_process,
					_timeIntervalList, _sampling, _gapSize,
					dynamic_cast<ParamDataTab2DDouble &>(_paramData), _useNearestValue);
			break;
		case ResamplingType::RT_WITHREFTIMELIST :
			_resampling = new ResamplingWithRefParam<ParamDataTab2DDouble>(_process,
				_timeIntervalList,
				dynamic_cast<ParamDataTab2DDouble &>(_paramData),
				_refParamData,
				_gapSize, _useNearestValue);
			break;
		}
	}

	/**
	 * @overload VisitorOfParamData::visit(ParamDataTab2DLongDouble *)
	 */
	virtual void visit(ParamDataTab2DLongDouble *) {
		switch (_type)
		{
		case ResamplingType::RT_WITHSAMPLINGTIME :
			_resampling = new ResamplingWithSamplingTime<ParamDataTab2DLongDouble>(_process,
					_timeIntervalList, _sampling, _gapSize,
					dynamic_cast<ParamDataTab2DLongDouble &>(_paramData), _useNearestValue);
			break;
		case ResamplingType::RT_WITHREFTIMELIST :
			_resampling = new ResamplingWithRefParam<ParamDataTab2DLongDouble>(_process,
				_timeIntervalList,
				dynamic_cast<ParamDataTab2DLongDouble &>(_paramData),
				_refParamData,
				_gapSize, _useNearestValue);
			break;
		}
	}

	/**
	 * @overload VisitorOfParamData::visit(ParamDataTab2DInt *)
	 */
	virtual void visit(ParamDataTab2DInt *) {
		switch (_type)
		{
		case ResamplingType::RT_WITHSAMPLINGTIME :
			_resampling = new ResamplingWithSamplingTime<ParamDataTab2DInt>(_process,
					_timeIntervalList, _sampling, _gapSize,
					dynamic_cast<ParamDataTab2DInt &>(_paramData), _useNearestValue);
			break;
		case ResamplingType::RT_WITHREFTIMELIST :
			_resampling = new ResamplingWithRefParam<ParamDataTab2DInt>(_process,
				_timeIntervalList,
				dynamic_cast<ParamDataTab2DInt &>(_paramData),
				_refParamData,
				_gapSize, _useNearestValue);
			break;
		}
	}

	/**
	 * @overload VisitorOfParamData::visit(ParamDataTab2DLogicalData *)
	 */
	virtual void visit(ParamDataTab2DLogicalData *) {
7578a549   Benjamin Renard   Add boolean suppo...
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
		switch (_type)
		{
		case ResamplingType::RT_WITHSAMPLINGTIME :
			// !! Force the use of the nearest value
			_resampling = new ResamplingWithSamplingTime<ParamDataTab2DLogicalData>(_process,
					_timeIntervalList, _sampling, _gapSize,
					dynamic_cast<ParamDataTab2DLogicalData &>(_paramData), true);
			break;
		case ResamplingType::RT_WITHREFTIMELIST :
			// !! Force the use of the nearest value
			_resampling = new ResamplingWithRefParam<ParamDataTab2DLogicalData>(_process,
					_timeIntervalList,
					dynamic_cast<ParamDataTab2DLogicalData &>(_paramData),
					_refParamData,
					_gapSize, true);
                        break;
                }
fbe3c2bb   Benjamin Renard   First commit
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
	}

	/**
	 * @brief Good resampling getter
	 */
	ResamplingAbstract* getResampling() const {
		return _resampling;
	}
private:
	ResamplingType _type;
	Process &_process;
	ParamData &_paramData;
	ResamplingAbstract *_resampling;
	TimeIntervalListSPtr _timeIntervalList;
	double _sampling;
	double _gapSize;
	ParamData& _refParamData;
	bool _useNearestValue;
};

} /* Resampling */
} /* AMDA */
} /* Parameters */

#endif /* Resampling_HH_ */