Opendial中触发Model依赖的是变量,流转,填槽以及赋值都是依靠变量进行传递的,这里描述一下在Opendial中变量的组织形式。
变量存放在哪里
public class BNetwork {// loggerfinal static Logger log = Logger.getLogger("OpenDial");// the set of nodes for the networkMap<String, BNode> nodes;// the chance nodesMap<String, ChanceNode> chanceNodes;// the utility nodesMap<String, UtilityNode> utilityNodes;// the action nodesMap<String, ActionNode> actionNodes;}
使用Map进行保存,在一次对话/流程的上下文中,这个数据是可以共享的。
产生变量的地方主要有以下几个
- 初始化的变量
- 运行过程中产生的变量,例如f44,f44.chen
- 临时变量,例如f44
- 最终变量,f44.chen
- 系统变量
- model的trigger
- rule的id
- 等等
每一次的更新都要计算变量
