crowdedjs / examples Goto Github PK
View Code? Open in Web Editor NEWA threaded, browser-based crowd simulation engine.
Home Page: https://crowdedjs.github.io/examples/
License: MIT License
A threaded, browser-based crowd simulation engine.
Home Page: https://crowdedjs.github.io/examples/
License: MIT License
We lost animation blending in the most recent version. We need to put that back in.
Describe the bug
The reported simulation fps can be inaccurate.
Expected behavior
The simulation fps is the actual fps.
I wrote the code to throw exceptions incorrectly. The exceptions should read:
throw new Exception(string)
not
throw new [string]
Make sure that we add non-determinism back into the simulation.
The draw callback (index.html) is not being used anymore. We could eliminate it or integrate the cade in viewer into this callback.
Right now the frame controller has play (reverse), pause, play (forward), and three different speeds (x1, x5, x10).
I think the frame controller should also have a back one frame, forward one frame, go to beginning, go to end, and track last frame options.
When a sev 1 arrives and is sent to an A bed, there is usually already a team assigned that will drop what they are doing to assist. This usually includes a doctor, a resident, a nurse, and a tech. Often phlebotomy will send someone and someone from imaging will also be on hand.
Patients often require:
A CAT scan
An EKG
An x-ray
A blood draw.
I believe we have the first two implemented, but not the latter two.
Delete unused and old code branches, try to narrow it down to main (my current build), and a dev branch (future branch).
I think that we're tracking location in two places (my fault). I think we have the locations array and a location (which is the last frame). I think the location variable is redundant since the information is already in the locations array.
A real ER is teaming with doctors, residents, nurses, and techs. Right now we have only one of each.
Right now all people (including patients) are created in the Medician object. Patients should be created in the patient object. This will allow us to leverage OOP better.
In alex-branch agents' animations were throttled by the distance the agent travelled. We lost that functionality when I merged.
The crowd speeds up after a shift change, suggesting a memory leak.
We need to have patients leave two ways--the way they came and by being booked into the main hospital.
See crowdedjs/math#1
In almost all places where we use distanceTo and length, we could use distanceToSquared and lengthSquared. Times include when we compared based on distance (x^2>y^2=>x>y) such as this updated line:
Or when we compare to a constant such as this updated line:
The only time we really need to use length instead of lengthSquared is when we normalize, so we need to keep it in for that.
In the assets repo, agents have their arrival encoded as a tick, e.g.
https://github.com/crowdedjs/assets/blob/c0841be5261f3762533a3a8c143a398b7f963619/arrivals/arrivalHospital.js#L4
Agents are spawned in crowd-setup based on their .startMSec attribute,
https://github.com/crowdedjs/crowd-setup/blob/12257fe45d6ad6abd108d7acfdcebd7c8d27184a/index.js#L75
The conversion from ticks to milliseconds take place in the agent constructors, e.g.
examples/src/people/patient-agent.js
Line 24 in 0edba95
The patient and tech circle endlessly
Add a global computer to the simulation.
Wanted to note here while I'm thinking of it, this is seemingly the case for Sev A patients and normal patients, as there are several spots where having multiple medical agents doesn't help for one reason or another. Some of those reasons include:
Sev 1 patients often arrive at the ambulance drop off. We need to handle this situation.
Putting this here so I remember it later.
Any sev 1 patients automatically should be put at the front of the queue.
We should be using the actual arrival data that represents an average day at the ER
https://github.com/crowdedjs/examples/blob/0fea4001d99c3e1e41659ca0714010e40cda8e37/src/index.js#L59
Commenting out this line makes the simulation run better, so clearly some optimizations need to be made!
6 am and 6 pm are shift changes (tentatively), 12 hour shifts. The greeter nurse only works from 9 to 5. There are one of three arrival times. Morning, Afternoon (swing), and Evening.
After some changes a long while ago, our scoring functions stopped working and outputs multiple errors into the console when the simulation starts. It looks like it's not something I can just comment out on my end as it is apart of the node_modules folders.
examples/node_modules/@crowdedjs/crowd-setup/index.js
(The errors was at line 188, "can't access property "id", agentPositionsRef[j] is undefined")
Work on speech bubbles
I've started to add animation state information into the behavior tree. Right now when a patient waits forever they switch to an idle animation. These animation updates needs to be integrated into all behaviors.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.