提交 | 用户 | 时间
|
7fd198
|
1 |
package com.iailab.module.model.mdk.sample; |
潘 |
2 |
|
|
3 |
import com.iailab.module.model.mdk.common.enums.TypeA; |
|
4 |
import org.springframework.beans.factory.annotation.Autowired; |
|
5 |
import org.springframework.stereotype.Component; |
|
6 |
|
|
7 |
/** |
|
8 |
* 样本工厂 |
|
9 |
*/ |
|
10 |
@Component |
|
11 |
public class SampleFactory { |
|
12 |
|
|
13 |
@Autowired |
|
14 |
private PredictSampleInfoConstructor predictSampleInfoConstructor; |
|
15 |
|
|
16 |
@Autowired |
45520a
|
17 |
private ScheduleSampleInfoConstructor scheduleSampleInfoConstructor; |
D |
18 |
|
|
19 |
@Autowired |
7fd198
|
20 |
private PredictSampleDataConstructor predictSampleDataConstructor; |
潘 |
21 |
|
|
22 |
/** |
|
23 |
* add by zfc 2020.12.15 重写createSampleInfo方法:不区分算法类型直接返回预测时间序列类型 |
|
24 |
* |
|
25 |
* @param typeA |
|
26 |
* @param modelId |
|
27 |
* @return |
|
28 |
*/ |
|
29 |
public SampleInfoConstructor createSampleInfo(String typeA, String modelId){ |
45520a
|
30 |
SampleInfoConstructor sampleInfoConstructor = null; |
7fd198
|
31 |
if (typeA.compareTo(TypeA.Predict.name()) == 0) { |
潘 |
32 |
sampleInfoConstructor = predictSampleInfoConstructor; |
054fb9
|
33 |
} else if (typeA.compareTo(TypeA.Schedule.name()) == 0) { |
45520a
|
34 |
sampleInfoConstructor = scheduleSampleInfoConstructor; |
7fd198
|
35 |
} |
潘 |
36 |
return sampleInfoConstructor; |
|
37 |
} |
|
38 |
|
|
39 |
public SampleDataConstructor createSampelData(String typeA) { |
|
40 |
SampleDataConstructor sampleDataConstructor = null; |
|
41 |
if (typeA.compareTo(TypeA.Predict.name()) == 0) { |
|
42 |
sampleDataConstructor = predictSampleDataConstructor; |
054fb9
|
43 |
} else if (typeA.compareTo(TypeA.Schedule.name()) == 0) { |
潘 |
44 |
sampleDataConstructor = predictSampleDataConstructor; |
7fd198
|
45 |
} |
潘 |
46 |
return sampleDataConstructor; |
|
47 |
} |
|
48 |
} |