Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在下面显示的 petrinet 中,我在在 input2 中创建具有随机值的令牌时遇到问题,因为 rand() 函数似乎不起作用。还有其他方法吗?
CPN ML 为小型颜色集提供随机颜色选择。您可以使用SmallInt.ran()[1,10] 范围内的随机整数。
SmallInt.ran()
REAL不是一个小的颜色集,如果你要使用REAL.ran()你会得到一个例外。
REAL
REAL.ran()
我猜想适合您的示例的解决方案是使用1.0/real(SmallInt.ran()).
1.0/real(SmallInt.ran())
我手头没有 CPN 工具的副本,所以请认真对待上述建议。
我在 railscasts.com 上观看了关于 Kaminari 的一集,并尝试将这个系统添加到我的博客中。但是这个错误一次又一次地出现,我不明白为什么。
来自帖子控制器的索引操作:
def index @posts = Post.order("title").page(params[:page])