运行模型每天8小时,连续3天(AnyLogic)

huangapple 未分类评论50阅读模式
英文:

Running the model for 8 hours each day for 3 days (AnyLogic)

问题

希望大家都安全,

1. 我的目标

我试图模拟一个为期3天的真实情况。系统每天只应该工作8小时。

我的目标是在3天内每天运行该模型8小时,以获得足够的数据进行分析。

2. 我的问题

我有一份代理预约的时间表,如图片1所示。我将模拟设置从2020年3月18日上午7:00运行到2020年3月20日下午3:00。现在模拟已经连续运行了56小时,但预约没有每隔8小时重复一次。

我需要:每次运行模型8小时,当模型再次运行时(因为是3天),模型应该重新考虑时间表中相同的预约。

我尝试过找到一种方法,输入一个代码,告诉Anylogic每天运行8小时,但我没有找到任何相关信息。我也不想为24小时的工作添加更多预约,我希望它能在3天内重复时间表。还有开始和暂停函数的布尔值,但我不知道应该把它们放在哪里。

有没有人有能帮助我的想法?

运行模型每天8小时,连续3天(AnyLogic)

谢谢。

英文:

Hope you are all safe,

1. My Goal

I am trying to simulate a real situation over 3 days. The system should work 8 hours per day only.

My goal is to run the model 8 hours for 3 days to have enough data to analyze.

2. My Problem

I have a schedule for agents' appointments as shown in photo 1. I put the simulation to run from 18.3.2020 at 7:00 am to 20.3.2020 at 3:00. Now the simulation is running 56 hours consecutively and the appointments are not repeated each 8 hours

What I need: Run the model for 8 hours, and when it reruns again (because it is 3 days) the model should reconsider the same appointments in the schedule.

I tried to find a way to input a code that tells Anylogic to run 8 hours every day but I didn't find anything. And I don't want to add more appointment for 24 hours of working, I want it to repeat the schedule for 3 days. AND, there are the boolean start and boolean pause functions, but I don`t know where should I put them.

Does anyone have an idea that can help me?

运行模型每天8小时,连续3天(AnyLogic)

Thank you.

答案1

得分: 0

就像本杰明提到的那样,您需要控制客户在8小时时间窗口内的到达。一种方法是通过将源的到达率更改为零来实现。这可以在时间表的操作块中完成。

traceln( timeToDate( time() ) + " Schedule Change value=" + value);

// 将源的到达率设置为零
if( value == 0 ){
  source.set_rate(0);
}	
// 将到达率重置回原始值
// 确保速率单位是正确的
else 
  source.set_rate(1, RateUnits.PER_HOUR);

运行模型每天8小时,连续3天(AnyLogic)

英文:

Just as Benjamin mentioned, you need to control the arrival of customers within the 8 hour schedule window. One way you can do this my turning off the arrival of the source by changing the arrival rate to zero. This can be done in the Action block of the schedule.

traceln( timeToDate( time() ) + " Schedule Change value=" + value);

// Setting the arrival rate of the Source to zero
if( value == 0 ){
  source.set_rate(0);
}	
// Resetting the arrival back to the original value
// Ensure that the rate units are correct 
else 
  source.set_rate(1, RateUnits.PER_HOUR);

运行模型每天8小时,连续3天(AnyLogic)

huangapple
  • 本文由 发表于 2020年4月9日 01:27:03
  • 转载请务必保留本文链接:https://java.coder-hub.com/61106468.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定