Giter VIP home page Giter VIP logo

clinic's Introduction

Clinic

A simulation of clinic's reception with a set number of workers and randomly generated patients written in C and a graph is drawn by python.

Task:
The work day is represented by a number of ticks and there is a known chance that a patient will show up during the tick. The patient has a randomly generated number of an illness and a chance to be healthy. They are sent to a random worker and if the patient is healthy or their illness number coincides with the worker's number, they are released after a set amount of ticks. If not, then after a set amount of time they are sent to the worker that has the right number. If the worker is busy at the time, the patient is put in the queue, until their time comes. The workers are paid for the number of patients they have received plus a set bonus (in case they did not receive any patients that day). If the workers are working overtime, they get a double pay for a released patient.

Option 1
The clinic has workers in specific areas that work faster than professional workers at the clinic and have a lower income. All the patients go to their area's worker, however that worker cannot cure the illness. Thus, if the patient is healthy, they are released, if not, they are immediately sent to the right professional worker at the clinic.

Option 2
The clinic does not have any area workers and the patients go right away to the professionals.

Find which option is more efficient and costs less.

Example:
800 ticks
30 chance that a patient will show up
100 professional workers
20 ticks a professional worker spends on one patient
50 money a professional worker gets per patient
80 area workers
10 ticks an area worker spends on one patient
25 money an area worker gets per patient

Solution 1 (compare the two options):
run on the console
$ make -f makefile2
$ ./polik
in created file rez.txt:
Only specialists
Patient happiness: min = 18, mid = 98, max = 128
Specialist wage = 32400

With local workers
Patient happiness: min = 13, mid = 8, max = 223
Specialist wage = 30225

Solution 2 (find the most efficient area worker number):
run on the console
$ make -f makefile2
$ python3 graph.py
the drawn graph will show how cost fluctuates by lowering the number of area workers.

clinic's People

Contributors

emilijasvirsk avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.