package com.qiwu.chatbotbackend.entity; import java.util.HashMap; import java.util.HashSet; /** * 保存配置文件每一行(单行)解析后的信息的实体类。 * 独立于引擎的另一种condition */ public class Condition { public int priority = -1; public int activePriority = 0; //如果本condition被其他condition激活 public int auxiliaryPriority = 0; //用于priority一样时人为设置的辅助优先级 public HashSet keywordSet = new HashSet(); public HashMap> historyPremise = new HashMap>(); public HashMap> currentPremise = new HashMap>(); public HashMap updateKnowledge = new HashMap(); public String[] answer = {"",}; public String nextStep = ""; public HashMap featureMap = new HashMap(); public String indexName = ""; public int id = 0; public String configName = ""; public String status = "waiting"; //public ArrayList indexName = new ArrayList(); public Condition(int priority) { this.priority = priority; this.activePriority = priority; } public Condition(Condition originCondition, int basePriority, int baseAuxiliaryPriority) { this.priority = originCondition.priority; this.keywordSet = originCondition.keywordSet; this.historyPremise = originCondition.historyPremise; this.currentPremise = originCondition.currentPremise; this.answer = originCondition.answer; this.nextStep = originCondition.nextStep; this.featureMap = originCondition.featureMap; this.updateKnowledge = originCondition.updateKnowledge; this.indexName = originCondition.indexName; this.id = originCondition.id; this.configName = originCondition.configName; this.status = originCondition.status; this.activePriority = originCondition.activePriority + basePriority; this.auxiliaryPriority = originCondition.auxiliaryPriority + baseAuxiliaryPriority; } public Condition() { } }