本文整理汇总了C#中Domain.ContainsPredicate方法的典型用法代码示例。如果您正苦于以下问题:C# Domain.ContainsPredicate方法的具体用法?C# Domain.ContainsPredicate怎么用?C# Domain.ContainsPredicate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Domain
的用法示例。
在下文中一共展示了Domain.ContainsPredicate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadInitState
private void ReadInitState(Problem p, Domain d, CompoundExpression eInitState)
{
foreach (Expression e in eInitState.SubExpressions)
{
CompoundExpression eSub = (CompoundExpression)e;
if(d.IsFunctionExpression(eSub.Type))
{
p.AddKnown(ReadFunctionExpression(eSub, null, d));
}
else if (d.ContainsPredicate(eSub.Type))
{
p.AddKnown(ReadGroundedPredicate(eSub, d));
}
else
{
if (eSub.Type != "unknown")
{
Formula f = ReadGroundedFormula(eSub, d);
if (f is CompoundFormula)
p.AddHidden((CompoundFormula)f);
if (f is PredicateFormula)//this happens in (not (p)) statments
p.AddKnown(((PredicateFormula)f).Predicate);
}
else
{
//causing a problem - add operand does some basic reasoning - adding p and ~p results in true for or statements.
//skipping unknown for now...
Predicate pUnknown = ReadGroundedPredicate((CompoundExpression)eSub.SubExpressions[0], d);
CompoundFormula cfOr = new CompoundFormula("or");
cfOr.SimpleAddOperand(pUnknown);
cfOr.SimpleAddOperand(pUnknown.Negate());
p.AddHidden(cfOr);
}
}
}
p.ComputeRelevanceClosure();
}