Infection Simulation

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
RogGuay
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 114
Joined: Fri Apr 28, 2006 12:10 am
Location: Seattle

Infection Simulation

Post by RogGuay » Wed Dec 29, 2021 4:35 am

Screen Shot 2021-12-28 at 7.03.29 PM.png
I just uploaded a stack called “Infection" to Sample Stacks which might be a little fun (in a scary way) for some of you. It’s a Monte Carlo simulation wherein a number of individuals randomly moving about in an enclosed space, are infected by a single randomly infected individual. I welcome any feedback that might lead to more accuracy in or improvement to this model.

Cheers,
Roger
Attachments
Infection.livecode.zip
(105.53 KiB) Downloaded 102 times

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9743
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Infection Simulation

Post by dunbarx » Wed Dec 29, 2021 4:19 pm

Hi.

Fun to watch. You might allow the contact distance to be modified. Right now it seems to be rather large. Also, allow the rate of motion to be modified. Every seems to be running around frantically. The current scenario is like a train station platform, with everyone late for trains just about to leave.

Craig

RogGuay
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 114
Joined: Fri Apr 28, 2006 12:10 am
Location: Seattle

Re: Infection Simulation

Post by RogGuay » Thu Dec 30, 2021 6:45 am

Thanks Craig. Apparently you missed the Parameters control panel where both the Contagious Zone and the Individual V(velocity) Diversity can be controlled:

Roger
Attachments
Screen Shot 2021-12-29 at 9.40.50 PM.png

stam
Posts: 2741
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Infection Simulation

Post by stam » Thu Dec 30, 2021 3:54 pm

Thanks Roger, very nice indeed, thank you.

Only thing i would add is if it's possible to set a duration of virulence - ie how long is each individual capable of transmitting infection.
At present this is indefinite, and therefore the entire population will eventually be infected. Which is also the flaw in this simulation.

It would be very interesting to see what happens happens if individuals are able to transmit infection for only a certain amount of time. Also in that case setting a period of 'immunity' whereby individuals infected and resolved will be immune for a period of time, perhaps semi-randomly (actually simulating real life in other words, assuming non-lethal infection).

Many thanks once again for the excellent simulation
Stam

Andy01
Posts: 14
Joined: Wed Dec 22, 2021 3:26 am

Re: Infection Simulation

Post by Andy01 » Fri Dec 31, 2021 11:47 am

All the best in the new year, just a suggestion could you introduce icons 32x32 pixels so it's more visual. An example could be infected = sad face vs not infected = happy face vs in-between :(, :),:l

RogGuay
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 114
Joined: Fri Apr 28, 2006 12:10 am
Location: Seattle

Re: Infection Simulation

Post by RogGuay » Fri Dec 31, 2021 7:48 pm

Thank you Stam and Andy. I will indeed work on your excellent suggestions.

Happy New Year!

Roger

Post Reply

Return to “Talking LiveCode”