简体   繁体   English

基于代理的 Anylogic,slider 和事件出错

[英]agent based Anylogic, error with slider and event

I have connected my slider to a parameter in the main, this parameter was accessed from a variable in the agent (person window).我已将我的 slider 连接到主参数,该参数是从代理(人员窗口)中的变量访问的。 The issue i'm facing is that the variable only takes the first updated value and does not change that.我面临的问题是该变量只采用第一个更新的值并且不会改变它。 As an attempt to solve the issue, I used an event that update the variable for the agent, but the event updates it to the same agent for a multiple time in the same time step.作为解决该问题的尝试,我使用了一个更新代理变量的事件,但该事件在同一时间步内多次将其更新为同一代理。

here is the pictures that describe the situation这是描述情况的图片

enter image description here在此处输入图像描述

enter image description here在此处输入图像描述

so please can you provide any help...所以请你能提供任何帮助......

if i understand your problem correctly, one way would be to do the following based on your already existent model:如果我正确理解您的问题,一种方法是根据您已经存在的 model 执行以下操作:

In your slider, on the action section, you can do the following for sliderMask as an example you can do the same with all the others:在您的 slider 中,在操作部分,您可以对 sliderMask 执行以下操作,例如您可以对所有其他操作执行相同操作:

for(Person person : people){
   person.maskOn=bernoulli(value); //value is what you chose on the slider
}

This will change the variable for all the agents这将更改所有代理的变量

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM