当前位置: 首页>>代码示例>>C++>>正文


C++ Plan::display方法代码示例

本文整理汇总了C++中Plan::display方法的典型用法代码示例。如果您正苦于以下问题:C++ Plan::display方法的具体用法?C++ Plan::display怎么用?C++ Plan::display使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Plan的用法示例。


在下文中一共展示了Plan::display方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

int main(int ac, char ** av)
{
   SLBag<XDString,StringComp>* additions, *deletions, *preconditions;
   additions = new SLBag<XDString,StringComp>;          
   deletions = new SLBag<XDString,StringComp>;
   preconditions = new SLBag<XDString,StringComp>;
   additions->addMember(new XDString("on c a"));
   additions->addMember(new XDString("on a table"));
   additions->addMember(new XDString("on b table"));
   additions->addMember(new XDString("clear c"));
   additions->addMember(new XDString("clear b"));              
   Operator* one = new Operator(additions,preconditions,deletions);
   delete additions;
   delete preconditions;
   delete deletions;
   additions = new SLBag<XDString,StringComp>;          
   deletions = new SLBag<XDString,StringComp>;
   preconditions = new SLBag<XDString,StringComp>;
   preconditions->addMember(new XDString("on a b"));
   preconditions->addMember(new XDString("on b c"));
   Operator* two = new Operator(additions,preconditions,deletions);  
   delete additions;
   delete preconditions;
   delete deletions;
   
   Step *start = new Step(one);
   Step *finish = new Step(two);
   
   Requirement* req = new Requirement(finish, new XDString("on a b"));
   Requirement* req2 = new Requirement(finish, new XDString("on b c"));
   SLBag<Step,StepComp>* steps = new SLBag<Step,StepComp>;
   SLBag<Constrain,ConstComp>* constraints = new SLBag<Constrain,ConstComp>;
   SLBag<Conflict,ConflictComp>* conflicts = new SLBag<Conflict,ConflictComp>;
   SLBag<Link,LinkComp>* links = new SLBag<Link,LinkComp>;
   SLBag<Requirement,ReqComp>* requirements = new SLBag<Requirement,ReqComp>;
   SLBag<Operator, OperatorComp>* operators = new SLBag<Operator, OperatorComp>;
   Constrain* constraint = new Constrain(start, finish);
   constraints->addMember(constraint);
  
   requirements->addMember(req);
   requirements->addMember(req2);
   steps->addMember(start);
   steps->addMember(finish);

   additions = new SLBag<XDString,StringComp>;          
   deletions = new SLBag<XDString,StringComp>;
   preconditions = new SLBag<XDString,StringComp>;
   preconditions->addMember(new XDString("on c a"));
   preconditions->addMember(new XDString("clear c"));
   additions->addMember(new XDString("on c table"));
   additions->addMember(new XDString("clear a"));
   deletions->addMember(new XDString("on c a"));
   Operator* op1 = new Operator(additions,preconditions,deletions);
   delete additions;
   delete preconditions;
   delete deletions;
   additions = new SLBag<XDString,StringComp>;          
   deletions = new SLBag<XDString,StringComp>;
   preconditions = new SLBag<XDString,StringComp>;
   preconditions->addMember(new XDString("on a table"));
   preconditions->addMember(new XDString("clear a"));
   preconditions->addMember(new XDString("clear b"));
   additions->addMember(new XDString("on a b"));
   deletions->addMember(new XDString("on a table"));
   deletions->addMember(new XDString("clear b"));
   Operator* op2 = new Operator(additions,preconditions,deletions);
   delete additions;
   delete preconditions;
   delete deletions;
   additions = new SLBag<XDString,StringComp>;          
   deletions = new SLBag<XDString,StringComp>;
   preconditions = new SLBag<XDString,StringComp>;
   preconditions->addMember(new XDString("on b table"));
   preconditions->addMember(new XDString("clear b"));
   preconditions->addMember(new XDString("clear c"));
   additions->addMember(new XDString("on b c"));
   deletions->addMember(new XDString("on b table"));
   deletions->addMember(new XDString("clear c"));
   Operator* op3 = new Operator(additions,preconditions,deletions);
   operators->addMember(op1);
   operators->addMember(op2);
   operators->addMember(op3);
   Plan* plan = new Plan(steps, conflicts, constraints, links, requirements, operators);   
   Heuristic* heuristic = new Heuristic;
   plan  = (Plan* )best(plan, plan, heuristic);
   plan->display();
   return 1;
}
开发者ID:MadMaxPavlo,项目名称:aima,代码行数:88,代码来源:testPlan.C


注:本文中的Plan::display方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。