-3

I have connected my slider to a parameter in the main, this parameter was accessed from a variable in the agent (person window). 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...

Fatima
  • 1
  • 1
  • 1
    Instead of trying to describe your code, you should [edit] your question to include the relevant code. – azurefrog Dec 07 '21 at 15:07
  • What do you actually want to achieve? Probably much easier ways to solve this if you tell us what you need :) – Benjamin Dec 07 '21 at 17:21
  • What we want to achieve is basically being able to change a variable from within the person agent with the use of the slider from the main. – Fatima Dec 07 '21 at 18:10
  • Please provide enough code so others can better understand or reproduce the problem. – Community Dec 13 '21 at 20:14

1 Answers1

0

if i understand your problem correctly, one way would be to do the following based on your already existent 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:

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

Felipe
  • 8,311
  • 2
  • 15
  • 31