简体   繁体   English

anylogic如何使用堆栈图或时间堆栈来捕获包含

[英]anylogic how to use stack chart or time stack for seize contains

I wanna represent the number of resources in Seize via stack chart or time stack. 我想通过堆栈图或时间堆栈表示Seize中的资源数量。 What kinds of input should be added in "Value"? 应在“值”中添加哪些输入?

It might be seize.contains ? 可能是seize.contains

Maybe you have a misrepresentation of the situation. 也许您对这种情况有误解。 There are no resources in the seize block. seize块中没有资源。 The seize block finds free resources to use, but you can have many seize or service modules requesting the same resources from the same resourcepool at the same time. seize块查找可用的免费资源,但是您可以有许多seize或服务模块同时从同一资源池中请求相同的资源。

What you really want to represent I think is the amount of resources that have been seized by the seize block and are currently being used. 您真正想代表的是我认为是seize块已占用并且当前正在使用的资源量。 There is no special function for that. 对此没有特殊功能。 You need to create a new variable for instance called numResources initially 0. 您需要为名为numResources的实例创建一个初始为0的新变量。

In the on seize action of the seize block you do: numResources++; 在seize块的on seize动作中,您可以执行以下操作:numResources ++;

and in the release block (when the resource is free again) you do in the on enter action: numResources--; 然后在发布块(当资源再次释放时)中,执行on enter操作:numResources--;

So in your chart you can use numResources to show what you want. 因此,您可以在图表中使用numResources来显示所需内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM