package com.iailab.module.model.mdk.sample;
|
|
import com.iailab.module.model.mdk.common.enums.TypeA;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Component;
|
|
/**
|
* 样本工厂
|
*/
|
@Component
|
public class SampleFactory {
|
|
@Autowired
|
private PredictSampleInfoConstructor predictSampleInfoConstructor;
|
|
@Autowired
|
private ScheduleSampleInfoConstructor scheduleSampleInfoConstructor;
|
|
@Autowired
|
private PredictSampleDataConstructor predictSampleDataConstructor;
|
|
/**
|
* add by zfc 2020.12.15 重写createSampleInfo方法:不区分算法类型直接返回预测时间序列类型
|
*
|
* @param typeA
|
* @param modelId
|
* @return
|
*/
|
public SampleInfoConstructor createSampleInfo(String typeA, String modelId){
|
SampleInfoConstructor sampleInfoConstructor = null;
|
if (typeA.compareTo(TypeA.Predict.name()) == 0) {
|
sampleInfoConstructor = predictSampleInfoConstructor;
|
} else if (typeA.compareTo(TypeA.Schedule.name()) == 0) {
|
sampleInfoConstructor = scheduleSampleInfoConstructor;
|
}
|
return sampleInfoConstructor;
|
}
|
|
public SampleDataConstructor createSampelData(String typeA) {
|
SampleDataConstructor sampleDataConstructor = null;
|
if (typeA.compareTo(TypeA.Predict.name()) == 0) {
|
sampleDataConstructor = predictSampleDataConstructor;
|
} else if (typeA.compareTo(TypeA.Schedule.name()) == 0) {
|
sampleDataConstructor = predictSampleDataConstructor;
|
}
|
return sampleDataConstructor;
|
}
|
}
|