本文整理汇总了C++中Place::getY方法的典型用法代码示例。如果您正苦于以下问题:C++ Place::getY方法的具体用法?C++ Place::getY怎么用?C++ Place::getY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Place
的用法示例。
在下文中一共展示了Place::getY方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: genHumanAction
void PNPGenerator::genHumanAction(string say_ask, string say_do, string action_do, string say_dont, string condition)
{
Place *p1 = pnp.addAction("findHuman",pnp.pinit); addActionToStacks("findHuman",pnp.pinit);
Place *p2 = pnp.addAction(say_ask,p1); addActionToStacks(say_ask,p1);
pair<Transition*,Place*> ptg = pnp.addCondition(" ",p2);
Place *p = ptg.second;
Transition* t1 = pnp.addTransition("["+condition+"]"); t1->setY(p->getY()-1); t1->setX(p->getX()+1);
Transition* t2 = pnp.addTransition("[saidYes]"); t2->setY(p->getY()+0); t2->setX(p->getX()+1);
Transition* t3 = pnp.addTransition("[saidNo]"); t3->setY(p->getY()+1); t3->setX(p->getX()+1);
Transition* t4 = pnp.addTransition("[timeout]"); t4->setY(p->getY()+2); t4->setX(p->getX()+1);
pnp.connect(p,t1); pnp.connect(p,t2); pnp.connect(p,t3); pnp.connect(p,t4);
Place *py = pnp.addPlace("Y",-1); py->setY(t2->getY()); py->setX(t2->getX()+1);
pnp.connect(t2,py);
Place *pn = pnp.addPlace("N",-1); pn->setY(t3->getY()); pn->setX(t3->getX()+1);
pnp.connect(t3,pn);
// say_do, action_do
Place *pd1 = pnp.addAction(say_do,py); addActionToStacks(say_do,py);
Place *pd2 = pnp.addAction(action_do,pd1); addActionToStacks(action_do,pd1);
ptg = pnp.addCondition("["+condition+"]",pd2);
Place *pg = ptg.second;
pg->setName("goal");
// say_dont
Place *pf1 = pnp.addAction(say_dont,pn); addActionToStacks(say_dont,pn);
Transition* tf1 = pnp.addTransition("[not humanDetected]"); tf1->setY(pf1->getY()); tf1->setX(pf1->getX()+1);
pnp.connect(pf1,tf1); pnp.connect(tf1,pnp.pinit);
pnp.connect(t1,pg); pnp.connect(t4,pnp.pinit);
pnp.addInterrupt(pnp.pinit, condition, pg);
}