A simulation for identifying the employment status of randomly generated graduated students.
April 16, 2021 · 8 min readAnother simulation came to my mind after joining the first "Online Science and Technology Fest 2021" event. I entered the Web Programming contest and quickly thought the concept of simulation after reading the event description.
Event Description:
"Create a webpage that the user can be able to trace the graduated student whether they are employed or unemployed."
I don't want to make my website having a static data, like every time the user runs the site, I don't want them to get the same result. I want the user to have a little bit of interaction and conclusion on my site base on the simulation that will somehow reflect in the actual process of employment.
Simulation
Person
Although the event description refers to graduated students, I like to generally call it as a Person.
Buildings
It has 2 categories: the Residential and the Industrial buildings. Residential buildings are the place where a Person spawns and call it as their home. Industrial buildings are the places where different sectors of job are located and it is the location where persons go to apply for a job.
Job Sectors
This refers to the different areas of jobs where the person choices based on his attributes or skills accordingly. Below are the sectors with the corresponding jobs:
School - Teacher
Police Station - Policeman
Hospital - Nurse/Doctor
Theatre - Actress
Construction Sites and Offices - Engineer
Attributes/Skills
It refers to the properties that randomly generated by the simulation to the Person. These attributes are the requirements needed to achieve in applying a job:
GWA (General Weighted Average), Logical Thinking, Creativity,
Physical Build, and Perseverance.
Skillset
A term used to classify a Person's combined attributes/skills. The skillset of a Person is the basis on which job sector it appropriately belongs to.
City
This refers to the collection of all buildings and persons location.
With all the terms laid out, now I need to make them interact with each other and make a system for organizing and have a dynamic flow of development.
First, I set up all the graphics such as the ground and roads for the city. The placement of the buildings, and the representation of persons. I need to have my simulation a minimalistic view to make my site less load of visuals.
I also need to make the city ground and the buildings separate layers to avoid overlapping of the person and the buildings when the person moves around the city.
Buildings
City Ground
I added the persons in the city programmatically in the simulation during every iteration of the program by simply putting circles with a radius of 13 units.
Persons are the only object in the simulation that is moving. They populate in the residential buildings and they search for a job in the city to apply for a job in different sectors. Therefore, persons move across the residential to the industrial buildings.
So, I need to set the locations of all residential and industrial buildings. Then I got these set of lists:
[[625, 30], [700, 30], [700, 100], 510, 240], [580, 280], [720, 250], [700, 320], [720, 400], [720, 450], [500, 515], [500, 580], [580, 580], [625 + 20, 30 + 20], [700 + 20, 30 + 20], [700 + 20, 100 + 20], [510 + 20, 240 + 20], [580 + 20, 280 + 20], [720 + 20, 250 + 20], [700 + 20, 320 + 20], [720 + 20, 400 + 20], [720 + 20, 450 + 20], [500 + 20, 515 + 20], [500 + 20, 580 + 20], [580 + 20, 580 + 20]]
This might be overwhelming, but this is just a start. I still need to define the physics of the person. Such as adding the speed property, adding the speed to the coordinates of the person in relation to the city, checking if the person has reached the destination of the industrial sector...
But the fundamental feature that our simulation should have is setting all the skillset's minimum requirements for every job sectors. I came up with the table below to represent an approximation of a real world jobs:
Then I got this:
Now that the fundamental feature has created, we need to have controls to have a simple interaction and a little variation on every simulation.
We also need to visually show the quantity of the employment status and type of job of all the persons in the simulation, since it is the main objective of our simulation, to show the variation of employment status.
Finally, after some days of sleepless nights, I finally created this simulation:
You can view the source code here:
And the website here:
Thank you for reading!
P.S. This is only an approximation of how the real world employment looks like.