本文整理汇总了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;
}