0

我正在实施 Anylogic 7.3.1 的银行办公室样本。我在源代码块中创建了 20 个代理。当任何代理进入源时,我想分配代理 ID。我为此编写了这段代码。

agent.enteredSystem = time();
if(agent.enteredSystem > 0)
{
if(count <100)
{
String customerId = "CId-";
customerId = customerId + count;
count++;
}   
}

有一个客户类,我已将 enterSystem 变量声明为 double。count 是在主类的图形编辑器中声明的静态变量。

我想将此 customerId 移动到队列块,然后延迟,但是当我将其写入文本文件时。customerId 有重复。帮我。提前致谢..

4

1 回答 1

1

我想您需要将您的 customerID 变量定义为 Customer 类的一部分,而不是嵌入到您的 if 语句中。

于 2016-04-11T10:05:05.713 回答