本文整理汇总了C#中Predicate.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Predicate.ToString方法的具体用法?C# Predicate.ToString怎么用?C# Predicate.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Predicate
的用法示例。
在下文中一共展示了Predicate.ToString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateReasoningAction
private Action CreateReasoningAction(Predicate pEffect, HashSet<Predicate> lPredicates)
{
KnowPredicate kpEffect = new KnowPredicate(pEffect);
if (Predicates.Contains(kpEffect))
return null;
Action a = new KnowledgeAction("Reasoning_" + pEffect.ToString());
a.Preconditions = new CompoundFormula("and");
foreach (Predicate pOther in lPredicates)
{
if (pOther != pEffect)
{
KnowPredicate kp = new KnowPredicate(pOther);
if (!Predicates.Contains(kp))
return null;
((CompoundFormula)a.Preconditions).AddOperand(new PredicateFormula(kp));
}
}
CompoundFormula cfEffects = new CompoundFormula("and");
cfEffects.AddOperand(new PredicateFormula(kpEffect));
a.SetEffects(cfEffects);
return a;
}
示例2: AddReasonedPredicate
private void AddReasonedPredicate(Predicate p)
{
if (p.Name == Domain.TRUE_PREDICATE)
return;
Debug.Assert(p.Name != Domain.FALSE_PREDICATE, "Adding P_FALSE to the state");
if (!m_lObserved.Contains(p))
{
if (p.Name != "Choice" && UnderlyingEnvironmentState != null)
{
if (p.Negation)
Debug.Assert(!UnderlyingEnvironmentState.Predicates.Contains(p.Negate()), "Adding the negation of a state variable" );
else
Debug.Assert(UnderlyingEnvironmentState.Predicates.Contains(p), "Adding the negation of a state variable");
}
AddObserved(p);
Debug.WriteLine("Reasoned: " + p);
Reasoned.Add(p.ToString());
}
}