示例#1
0
        /// <summary>
        /// foamliu, 2009/01/21, 建立 Add-Effects 边.
        /// </summary>
        private void CreateAddEdges(Action theAct)
        {
            Conjunction add = theAct.AddEffects;

            foreach (string s in add.Literals)
            {
                Proposition theProp = m_next.AddProposition(s);
                theProp.AddAddEdge(theAct);
                theAct.AddAddProp(theProp);
            }
        }
示例#2
0
        /// <summary>
        /// foamliu, 2009/01/21, 添加 No-op actions.
        /// </summary>
        private void AddNoops()
        {
            Conjunction conj = m_prev.Conjunction;

            foreach (string s in conj.Literals)
            {
                // 创建 No-op action.
                Action theAct = new Action("NOOP: " + s);
                theAct.PreCondition.Literals.Add(s);
                theAct.AddEffects.Literals.Add(s);
                this.m_actions.Add(theAct);
                // 把这个 no-op 加入当前行为层.
                Proposition theProp = m_prev.GetProposition(s);
                theProp.AddPreEdge(theAct);
                theAct.AddPreProp(theProp);
                // 把这个命题加入下个命题层.
                theProp = m_next.AddProposition(s);
                theProp.AddAddEdge(theAct);
                theAct.AddAddProp(theProp);
            }
        }