Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Agant] Update Object Property ReactJS #13

Open
mahmoodhussam opened this issue Apr 27, 2024 · 6 comments
Open

[Agant] Update Object Property ReactJS #13

mahmoodhussam opened this issue Apr 27, 2024 · 6 comments

Comments

@mahmoodhussam
Copy link

I am trying to launch Incremental Tutorials in ReactJS but I faced an issue with the colors of infected agents not being updated

Code:
https://github.com/gama-platform/gama.old/blob/GAMA_1.9.3/msi.gama.models/models/Tutorials/Predator%20Prey/models/Model%2004.gaml

Screenshot:
Screenshot 2024-04-27 at 4 06 12 PM

@hqnghi88
Copy link
Member

Hi,
Can you try to declare an attribute in road species: rgb color<-rnd(255);

@mahmoodhussam
Copy link
Author

I have tried to do that it worked but I can not update it to red or another color if an agent became infected

@mahmoodhussam
Copy link
Author

@hqnghi88 any idea?

@hqnghi88
Copy link
Member

Hi, can you specify more detail on what worked what dorsnt, with color attribute if it show the color it must be possible to update when simulation change it

@mahmoodhussam
Copy link
Author

it worked by changing the code from
draw circle(5) color:is_infected ? #red : #green;
to update the color from reflect itself

@hqnghi88
Copy link
Member

hqnghi88 commented May 9, 2024

Hi,
So it mean the issue come from the GAML model that you used, it did not have the implement to change the color.
I let you close the issue if it is not the case anymore.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants