如何根据来源定义延迟时间? [英] How to define the delay time based on the source?

查看:41
本文介绍了如何根据来源定义延迟时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是使用 AnyLogic 的新手,我没有很多编程知识,我认为明确这一点很重要.我很早就做了另一个问题,但我认为我没有很好地解释它.所以,现在我想尝试这样做:

i'm new using AnyLogic and i don't have many knowledge of programmation, i think that is important to make that clear. I did another question early but i think that i dont explain it very well. So, now i wanna try to do that:

好的,我需要做一个关于访问控制的模型,事情是这样的:我的过程有两个延迟 1. 汽车/公共汽车/拖车的修订.2.注册,但是,修改过程中的延迟时间因汽车类型而异,例如修车保安花费2分钟,修拖车花费10分钟.我想说清楚延迟块中的差异,因为我想让我的模型看起来像这样:AnyLogic 模型

Ok, i need to do a model about an access control, and here is the thing: my process has two delays 1. revision of the car/bus/trailer. 2. registration, but, the time of delay in the revision process is different depending on the type of the car, e.g. to revise the car the security guard expend 2 minutes, and to revise the trailer expend 10 minutes. I want to make it clear that difference in the delay block, because i want to my model look like this: AnyLogic Model

问题是我不知道该怎么做,我也尝试做我在这本书上读到的不同的事情,但我遇到了很多问题.如果这里的每个人都能以简单的方式帮助我做到这一点,我将不胜感激.

The problem is that i don't know how to do that, i tried to do different things that i read on this foro but i had many problems. If everyone here can help me to do that in a easy way i'll be very grateful.

推荐答案

取决于您如何区分代理.假设您的代理类型中有一个布尔参数 isCar:

Depends how you differentiate your agents. Assume there is a boolean parameter isCar in your agent type:

然后,在延迟块的延迟时间"中代码,你可以简单地写 agent.isCar ?2 : 10

Then, in the delay block's "delay time" code, you can simply write agent.isCar ? 2 : 10

如果您有不同的代理类型 CarTrailer 流过延迟块,您将需要编写 agent instanceof Car ?2 : 10

If you have different agent types Car and Trailer flowing through the delay block, you would need to write agent instanceof Car ? 2 : 10

但是您需要了解更多基础知识.做教程,研究许多示例模型,以了解如何做事.学习 OOP、Java 并阅读 这篇 文章以了解上述 agent 的含义.

But you need to understand a lot more of the basics. Do the tutorials, study MANY of the example models to get a feel for how to do things. Learn OOP, Java and read this article to understand what agent means above.

这篇关于如何根据来源定义延迟时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆