{"id":25228244,"url":"https://github.com/umaxcode/barbering_shop_simulation","last_synced_at":"2025-04-05T13:41:14.580Z","repository":{"id":232380395,"uuid":"784192617","full_name":"UmaxCode/barbering_shop_simulation","owner":"UmaxCode","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-12T07:44:01.000Z","size":41,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-11T09:54:05.804Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/UmaxCode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-09T11:21:17.000Z","updated_at":"2024-04-10T17:24:15.000Z","dependencies_parsed_at":"2025-02-11T19:32:47.684Z","dependency_job_id":null,"html_url":"https://github.com/UmaxCode/barbering_shop_simulation","commit_stats":null,"previous_names":["umaxcode/barbering_shop_simulation"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UmaxCode%2Fbarbering_shop_simulation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UmaxCode%2Fbarbering_shop_simulation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UmaxCode%2Fbarbering_shop_simulation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UmaxCode%2Fbarbering_shop_simulation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UmaxCode","download_url":"https://codeload.github.com/UmaxCode/barbering_shop_simulation/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247345672,"owners_count":20924097,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-11T09:52:04.166Z","updated_at":"2025-04-05T13:41:14.553Z","avatar_url":"https://github.com/UmaxCode.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Barbering Shop Simulation (Java) \n\nThis is a barbering shop simulation where the owner has two types of chairs for hair trimming:\n- Main chair (1 chair which is the first chair)\n- Waiting chair (5 chairs) \n\nIn Total there are only 6 chairs in the shop. The owner of the shop has two types of clients:\n- VIP (special customers)\n- ORD (ordinary customers)\n\nTo keep track of the type of customers and their seating arrangement, the owner uses an\nindexing system. The ordinary customer is labelled ORD1 , ORD2 , ORD3 , etc. In a similar way\nspecial customers are labelled VIP1 , VIP2 , VIP3 , etc.\n\n### The seating and movement of customers in the salon follows these rules:\n- When a client comes in, and both **main** and **waiting** chairs are empty, he sits in the **main**\n   chair to have his hair trimmed. \n- Any other client who comes into the shop while the **main** chair is occupied, will sit in the\n   **waiting** chairs according to their arrival order. A client sits only if there is an available chair,\n   otherwise he/she will have to leave the shop and come back later, regardless of their type\n   ( **ORD** or **VIP** ) . \n- When a **VIP** comes into the shop while and the **main** chair is occupied and there is an\n   available **waiting** chair, he sits in the **first waiting** chair so that he/she can be the next to sit in\n   the **main** chair. If there was an **ORD** client in the **first waiting** chair, that **ORD** client has to\n   move to the next seat making everyone in the queue to shift backward by one seat. \n- If a **VIP** is already in the queue, the next **VIP** who arrives will take seat after the **last VIP** . \n- When the barber is done with the client in the **main** chair, the next seated in **chair No. 1** takes\n   his place and the rest of the clients shift successively to occupy the next chairs and leave the\n   empty chair behind them. \n- When clients have their hair trimmed, they leave and do not come back to the shop again.\n\n### To determine whether a client is serviced or not when he/she enters the shop\nA random number (0 - 3 inclusive) is generated say **x**:\n- If **x = 0** : the event is ( -- clientName ), meaning the barber is done trimming the hair\n  of the current client ( ORDi or VIPi where i = 1, 2, 3 ...) seated in the main chair.\n- If **x = 1** : the event is ( ++ VIPi ) meaning a **VIP** number 'i' has come into the shop and is\n  seated.\n- If **x = 2 or x = 3** : the event is ( ++ ORDi ) meaning an **ORD** number 'i' has\n  come into the shop and is seated.\n- If all the seats are occupied and **x \u003e 0**, the event is ( +- clientName ) meaning the\n  client has come and is gone back.\n  upon a new simulation, the program will display a new line following this format:\n  x ---\u003e ( event ) [ sitting order of clients in the shop ]\n\n*Eg. 1 ---\u003e ( ++ VIP1 ) [ VIP1 : ---- : ---- : ---- : ---- : ----]*\n\n**NOTE :**\nThe program asks from a keyword input\n- if the user enters the **space key**, the program will generate the random number and proceed with execution\n- if the user enters any other key different from the space key, the program quits.\n\n# THANK YOU\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumaxcode%2Fbarbering_shop_simulation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fumaxcode%2Fbarbering_shop_simulation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumaxcode%2Fbarbering_shop_simulation/lists"}