检查另一个Statechart代理的状态键入任何logic

发布于 2025-02-02 18:41:52 字数 240 浏览 4 评论 0原文

我在一个代理类型(人)的statechart中,我想在某个状态(athome)中向其他代理类型(person2)发送消息,但是当我使用下面的代码时,该程序会给我带来

for( Person2 m : main.person2s ) {

   if( m.inState(atHome)==true ) { 
       send("hi", m);
   }
}

错误在某个状态下调用其他代理类型?

I am in the statechart of the one agent type (Person) and I want to send a message to another agent type (Person2) in a certain state (atHome), but when I use code below the program throws me an error

for( Person2 m : main.person2s ) {

   if( m.inState(atHome)==true ) { 
       send("hi", m);
   }
}

what should I do to call another agent type in a certain state?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

魄砕の薆 2025-02-09 18:41:52

试试看

for( Person2 m : main.person2s ) {

   if( m.inState(m.atHome) ) { 
       send("hi", m);
   }
}

Try this instead

for( Person2 m : main.person2s ) {

   if( m.inState(m.atHome) ) { 
       send("hi", m);
   }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文