如何通过模型的时间来获取一周的数字?
我该如何在模型的任何时刻获得一年的一年数?
感谢您的帮助!
How can I get the week number of the year by the model's time in Anylogic?
Thank for your help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只需调用
时间(周)
返回几周内的当前型号时间即可。
如果您需要一年的相对星期数(0-51),则可以使用
getDayofYear(date(date()) / 52。< / code>,然后将其围绕您喜欢的方式。
getDayofyear
给出了当前型号时间一年的相对日(0-364)Simply call
time(WEEK)
Returns the current model time in weeks.
If you need the relative week number of a year (0-51), you can use
getDayOfYear(date()) / 52.
and then round it how you like.getDayOfYear
gives the relative day of a year for the current model time (0-364)这是我的代码,该代码返回模型的时间(如果一周在星期一开始):
This is my code that returns the week number by the model's time (if the week starts on Monday):