在CPN工具中,创建了一个整数Colset,充当索引

发布于 2025-02-01 19:30:02 字数 527 浏览 2 评论 0原文

我是CPN工具的新手,并且已经介绍了网站上的一些现实示例。 在我的网络中,我想拥有一个带有正整数值的col集合,如

上述MWE的问题是,每当触发过渡时,我都会得到一个具有值1的令牌。我希望每次过渡火灾时都会增加整数值。

相关问题/资源:

我看着相关的未解决问题,它也有类似的问题,但他们希望从1到n。 就我而言,我不知道要解雇多次过渡。

网站中的示例(协议,网络模拟等)具有网络,其中有一些固定数量的数据。但是,这不能解决我的问题。

I am new to CPN-Tools, and have gone over some of the Real world examples on the website.
In my net, I would like to have a col set with positive integer values as shown in this figure.

The issue with the above MWE is, whenever the transition is fired, I get a token with the value 1. I would like the integer value to be incremented every time the transition fires.

Related questions/resources:

I looked at a related unanswered question, which has a similar issue, but they want to range from 1 to n.
In my case, I don't know beforehand how many times the transition will be fired.

The examples in the website (protocols, network simulations etc) have nets where there are some fixed number of data that is passed around. However, this does not solve my problem.

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

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

发布评论

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

评论(2

锦爱 2025-02-08 19:30:02

如果您想拥有无限索引,则需要另一个地方存储并保持其当前价值。
然后,您可以使用弧线上的变量来增加原始值。

我做了一个示例来帮助您了解CPN的可能性:

”增量cpn“

如您所见,当触发T0时,P0中的值会增加1。
在此示例中,您只需要使用正确的COLSET创建变量,var x,y:int
我刚刚在P0中使用0给出了初始标记以启动计数器。

If you want to have an infinite index, you need another place to store and keep its current value.
Then, you can use a variable on the arc to increment the original value.

I did an example to help you see how it is possible with cpn:

Increment cpn

As you can see, when t0 is fired, the value in p0 is incremented by 1.
You just need to create variables with the right colset, var x,y: INT in this example.
I just gave an initial marking with 0 in p0 to start the counter.

何以畏孤独 2025-02-08 19:30:02

通过添加 damdamo https://stackoverflow )可能导致额外不必要的国家空间探索问题。


实现欲望输出的另一种方法是在T0上使用globRef和SML代码。全球价值就像全局变量。显示的代码显示为屏幕截图。

By adding extra place and arc like p0 mentioned by damdamo it is possible that it leads to extra unnecessary state space exploration problem.

CPNTools Screenshot
Another way to achive desire output is to use globref and SML code at t0. globref value is like global variable. the code as an example is shown is screenshot.

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