在模型中显示代理移动和时间

Display Agent movement and Time within the Model

我在 Final State 的代理图表中使用以下代码来显示系统内的代理移动。

System.out.println("I came in at " + TimeIn + " and exited at " +TimeOut + " and spent " + TimeInSystem + " seconds in the system");

当我 运行 模型时控制台中显示的输出。

我想在主 window 中显示输出。我看过示例,其中集合用于显示有关代理进度的输出信息。这并不简单。是否可以向我解释如何在累积代理的主文本中显示输出?

谢谢

只需使用您可以在演示面板中找到的文本元素,最初为空

每次你想打印你都可以

text.setText(text.getText()+"I came in at " + TimeIn + " and exited at " +TimeOut + " and spent " + TimeInSystem + " seconds in the system\n");