Skip to content

CMSC 447 Group 8 Project: Scheduling Program for John's Hopkins University

Notifications You must be signed in to change notification settings

umbc-447-group8/447-scheduler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

447-scheduler

CMSC 447 Group 8 Project: Scheduling Program for John's Hopkins University

Dependencies

  • Python2
  • pip
  • Flask (pip install flask)
  • Flask (pip install flask-restful)
  • Flask (pip install flask-cors)
  • OR-Tools (python -m pip install --user ortools)

Installation

  1. Clone the repo.
  2. Open the repo in your file explorer.
  3. Double-click the install folder.
  4. Double-click the install.bat file.
  5. If a User Account Control window open asking if you would like to allow Python to make changes to your computer, select yes.
  6. Wait for the terminal to close.

Running the API server

  1. Clone the repo
  2. cd api
  3. python api.py
  4. Go to http://127.0.0.1:5000 to see homepage for the API
  5. Go to http://127.0.0.1:5000/api/v1/employees to see a list of all employees
  6. Go to http://127.0.0.1:5000/api/v1/employees/{EMPLOYEE_ID} to see single employee
  7. Go to http://127.0.0.1:5000/api/v1/keys to see a list of all keys
  8. Go to http://127.0.0.1:5000/api/v1/keys/{API_KEY_ID} to see single API key
  9. Go to http://127.0.0.1:5000/api/v1/locations to see a list of all locations
  10. Go to http://127.0.0.1:5000/api/v1/locations/{LOCATION_ID} to see single location
  11. Go to http://127.0.0.1:5000/api/v1/requests to see a list of all employee requests
  12. Go to http://127.0.0.1:5000/api/v1/requests/{REQUEST_ID} to see single request

Running the UI server

  • Ensure flas-cors is installed pip install flask-cors
  1. cd ui
  2. python2: python server.py (This script can also be passed a custom IP and port)
  3. python3 python -m http.server
  4. Ensure the API server is also running
  5. Navigate http://localhost:8000

Supported API Methods:

  • Get
  • Post
  • Put (Must specifiy id as an endpoint)
  • Delete (Must specifiy id as an endpoint)

API Schemas:

Employees:

[
  {
    "employee_id": "DR001",
    "id": 0,
    "firstName": "Steven",
    "firstName": "Strange",
    "type": "Doctor",
    "moonlighter": true
  },
  {
    "employee_id": "PA002",
    "id": 1,
    "firstName": "Claire",
    "firstName": "Temple",
    "type": "PA",
    "moonlighter": false
  }
]

API Keys:

[
  {
    "id": 0,
    "key": "bfxgdsxbtgfegsvtfrsdhrshtrsht",
    "name": "testKey"
  },
  {
    "id": 1,
    "key": "gtrsgtrgt4esgt4ht",
    "name": "newkey2"
  }
]

Locations:

[
  {
    "coverage": [
      [1, 1, 1],
      [1, 1, 1],
      [1, 1, 1],
      [1, 1, 1],
      [1, 1, 1],
      [1, 1, 1],
      [1, 1, 1]
    ],
    "id": 0,
    "name": "Location A"
  },
  {
    "coverage": [
      [1, 1, 0],
      [1, 1, 0],
      [1, 1, 0],
      [1, 1, 0],
      [1, 1, 0],
      [1, 1, 0],
      [1, 1, 0]
    ],
    "id": 1,
    "name": "Location B"
  }
]

Requests:

[
  {
    "day": 3,
    "employee_id": "DR001",
    "request_id": 0,
    "shift": 0,
    "weight": -2
  },
  {
    "day": 4,
    "employee_id": "PA001",
    "request_id": 1,
    "shift": 3,
    "weight": 4
  },
  {
    "day": 57,
    "employee_id": "DR001",
    "request_id": 2,
    "shift": 1,
    "weight": -2
  }
]

Running the scheduler

  1. Clone the repo
  2. cd scheduler
  3. python scheduler.py > scheduler_log.txt

Some notes and TODO's for the scheduler:

  • If you wish to add any changes to how it runs (like change the number of employees, weeks, etc), make these changes in the scheduler_config.py file in the same directory. This is where information will eventually be pulled in the end product.
  • Once this is set up a bit more, moonlighters' availability will be added as requests, with a small weight so they will only be used if needed
  • Right now static sample data is in scheduler.py, but once we get the database all set up, a way to pull from the DB and set it in the script will be implemented.
  • Also right now, there is only one config for proof of concept purposes. Once we get more of the architecture set up, the config file will be generated based on whether this is scheduling for doctors or nurses
  • For handling multiple locations, it may be best to conbine the cover demands for each and schedule in one go. That way, we don't have to check if an employee is already scheduled every time we find a viable schedule.

About

CMSC 447 Group 8 Project: Scheduling Program for John's Hopkins University

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published