Skip to content

Commit

Permalink
Finished updating READMEs
Browse files Browse the repository at this point in the history
  • Loading branch information
ribsthakkar committed Aug 14, 2020
1 parent 256c956 commit aa66ce4
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 40 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ is a child parameter of the field before the "." See the
| database.url | String | URL to PostgreSQL database. Ignored if database.enabled is False |
| geocoder_key | String | API Key for geocoding. Currently only support [OpenCage Geocoder](https://opencagedata.com/api) |
| trips_parser | String | Parser used to read the incoming trips file. See more [here](./avicena/parsers/README.md) |
| optimizer | String | Model used to calculate and assign trips |
| optimizer | String | Model used to calculate and assign trips. See more details below. |
| seed | Integer | Sets the Python random seed. |
| merge_address_table_path | String | Path to CSV representation of merge_address_table. Ignored if database.enabled is True. |
| revenue_table_path | String | Path to CSV representation of revenue rate. Ignored if database.enabled is True. |
Expand All @@ -92,8 +92,8 @@ their configuration definitions. Samples are also provided in the

| Optimizer | Configuration Details | Comments |
|--------------------- |------------------------ |--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| GeneralOptimizer | [Glossary](./avicena/optimizers/Config.md#GeneralOptimizer) | Self Developed Formulation to Solve Problem |
| PDWTWOptimizer | [Glossary](./avicena/optimizers/Config.md#PDWTWOptimizer) | Formulation from following paper with additional fairness constraints integrated [here]() |
| GeneralOptimizer | [Glossary](./avicena/optimizers/README.md#GeneralOptimizer) | Self Developed Formulation to Solve Problem |
| PDWTWOptimizer | [Glossary](./avicena/optimizers/README.md#PDWTWOptimizer) | (Not working in non-experimental mode yet) Formulation from following paper with additional fairness constraints integrated [here]() |

#### Database Setup (optional)
The command-line application supports interfacing with a PostgreSQL
Expand Down
3 changes: 3 additions & 0 deletions avicena/optimizers/BaseOptimizer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class BaseOptimizer:
def solve(self, solution_file):
raise NotImplementedError("Cannot Solve")
3 changes: 2 additions & 1 deletion avicena/optimizers/GeneralOptimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
from docplex.mp.utils import DOcplexException

from avicena.models import Trip, Location
from avicena.optimizers.BaseOptimizer import BaseOptimizer
from avicena.optimizers.solver_util.cplex.Listeners import GapListener, TimeListener
from avicena.util.Exceptions import InvalidTripException, SolutionNotFoundException
from avicena.util.Geolocator import find_coord_lat_lon
from avicena.util.ParserUtil import convert_time
from avicena.util.TimeWindows import get_time_window_by_hours_minutes


class GeneralOptimizer:
class GeneralOptimizer(BaseOptimizer):
def __init__(self, trips, drivers, name, date, speed, config):
self.drivers_inp = drivers
self.trips_inp = trips
Expand Down
14 changes: 13 additions & 1 deletion avicena/optimizers/Config.md → avicena/optimizers/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
There is currently only one working Optimizer in Avicena:
* GeneralOptimizer

There is experimental code for the PDWTWOptimizer, but it is still under
development.

All Optimizers must be classes that extend from BaseOptimizer, and must
implement the `solve(self, solution_file) -> Pandas.DataFrame` method.

## Configuration Glossary
Below is a gloassary of the expected parameters in the
`config/optimizer_config.yaml` file when using Avicena depending on
which optimizer is specified in `config/app_config.yaml`.

## GeneralOptimizer
### GeneralOptimizer
| Parameter | Default Value | Comments |
|--------------------- |------------------------ |--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| TRIPS_TO_DO | 1000 | Increase if more than 1000 trips for the day. Otherwise model will automatically adjust for correct number of trips. If set to less than number of trips in file then it will only run the model on the first subset of trips. |
Expand All @@ -25,3 +35,5 @@ which optimizer is specified in `config/app_config.yaml`.
| STAGE2_GAP | 0.05 | Target MIP Gap for Stage 2 |

## PDWTWOptimizer
The PDWTW Optimizer is not been fully implemented in a non-experimental
mode.
19 changes: 19 additions & 0 deletions avicena/parsers/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
There are two parsers implemented in Avicena
* CSV
* LogistiCare

All parser modules must implement to the following function header:

`parse_trips_to_df(path_to_trips_file: str, merge_details:
Dict[str:MergeAddress], revenue_table: Dict[str:List[RevenueRate]],
output_directory: str) -> Pandas.DataFrame`

## CSV
The CSV Parser takes a CSV of input trips with the following header:
`date,trip_id,customer_name,trip_pickup_time,trip_pickup_name,trip_pickup_address,trip_dropoff_time,trip_dropoff_name,trip_dropoff_address,trip_los,trip_miles`
to produce the trip assignments.

## LogistiCare
This is a parser used to parse the PDFs from LogistiCare with its
proprietary formatting.

70 changes: 35 additions & 35 deletions sample_data/sample_trips.csv
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
date,trip_id,trip_status,trip_county,customer_name,customer_age,trip_pickup_time,trip_pickup_name,trip_pickup_address,trip_dropoff_time,trip_dropoff_name,trip_dropoff_address,trip_los,trip_miles
1/2/20,01-A,NEW,Travis,Mona Stobo,51,0.15625,Residence,"2004 Tom Miller St, Austin, TX, 78723",0.231731142,Davita South Austin Dialysis,"6114 S First St , Austin , TX 78745-4008",A,11
1/2/20,02-A,NEW,Travis,Marieann Shalcros,44,0.1770833,Residence,"1800 Wheless Ln, Austin, TX, 78723",0.183945222,Satellite Healthcare Mueller,"1801 E 51st St , Apt . 100 , Bldg . G , Austin , TX 78723-3434",A,1
1/2/20,03-A,NEW,Travis,Trista Igonet,62,0.1979167,Residence,"5805 Sweeney Cir, Austin, TX, 78723",0.245950154,Austin Travis County Integral,"1631 E 2nd St , Bldg . A C & D , Austin , TX 78702-4490",A,7
1/2/20,04-A,NEW,Travis,Chevalier Boyne,52,0.2604167,Residence,"1414 Larkwood Dr, Austin, TX, 78723",0.342759764,Mars Methadone Clinic ( Austin-,"1110 W William Cannon Dr , Apt . 303 , Austin , TX 78745-5468",W,12
1/2/20,05-A,NEW,Travis,Jilly Golden,58,0.2708333,Residence,"2700 Aftonshire Way #B, Austin, TX, 78748",0.353176364,Austin Travis County Integral,"1631 E 2nd St , Bldg . D , Austin , TX 78702-4490",W,12
1/2/20,06-A,NEW,Travis,Freemon Flarity,62,0.2708333,Residence,"2204 Allred Dr, Austin, TX, 78748",0.346314442,Austin Travis County Integral,"1631 E 2nd St , Bldg . A , Austin , TX 78702-4490",W,11
1/2/20,07-A,NEW,Travis,Emmaline Cavet,60,0.28125,Residence,"2540 Lavendale Ct, Austin, TX, 78748",0.363593064,Austin Travis County Integral,"1631 E 2nd St , Austin , TX 78702-4490",W,12
1/2/20,08-A,NEW,Travis,Carolee Tremonte,50,0.3125,Residence,"8600 N Fm 620, Austin, TX, 78726",0.429152674,Peoples Community Clinic ( Aust,"1101 Camino La Costa , Austin , TX 78752-3930",A,17
1/2/20,09-A,NEW,Travis,Cord Tremathack,61,0.3125,Residence,"17525 Bridgefarmer Blvd, Pflugerville, TX, 78660",0.504633816,Mars Methadone Clinic ( Austin-,"1110 W William Cannon Dr , Apt . 303 , Austin , TX 78745-5468",A,28
1/2/20,01-B,NEW,Travis,Mona Stobo,51,0.3229167,Davita South Austin Dialysis,"6114 S First St , Austin , TX 78745-4008",0.398397842,Residence,"2004 Tom Miller St, Austin, TX, 78723",A,11
1/2/20,02-B,NEW,Travis,Marieann Shalcros,44,0.3229167,Satellite Healthcare Mueller,"1801 E 51st St , Apt . 100 , Bldg . G , Austin , TX 78723-3434",0.329778622,Residence,"1800 Wheless Ln, Austin, TX, 78723",A,1
1/2/20,10-A,NEW,Travis,Kandy Stanyon,76,0.3229167,Residence,"15711 Dessau Rd #APT 904, Pflugerville, TX, 78660",0.384673998,Satellite Dialysis- Metric,"10000 Metric Blvd , Austin , TX 78758-5202",A,9
1/2/20,03-B,NEW,Travis,Trista Igonet,62,0.34375,Austin Travis County Integral,"1631 E 2nd St , Bldg . A C & D , Austin , TX 78702-4490",0.391783454,Residence,"5805 Sweeney Cir, Austin, TX, 78723",A,7
1/2/20,11-A,NEW,Travis,Kilian Juzek,71,0.3645833,Residence,"14748 Olive Hill Dr, Austin, TX, 78717",0.522407506,Davita El Milagro,"2800 S I H 35 , Austin , TX 78704-5700",W,23
1/2/20,14-A,NEW,Bell,Tiff Doveston,61,0.36875,Residence,"737 Mckay Ln, Salado, TX, 76571",0.50753649,Austin Travis County Integral,"825 E Rundberg Ln , Apt . F , Austin , TX 78753-4808",A,45
1/2/20,05-B,NEW,Travis,Jilly Golden,58,0.4166667,Austin Travis County Integral,"1631 E 2nd St , Bldg . D , Austin , TX 78702-4490",0.499009764,Residence,"2700 Aftonshire Way #B, Austin, TX, 78748",W,12
1/2/20,06-B,NEW,Travis,Freemon Flarity,62,0.4270833,Austin Travis County Integral,"1631 E 2nd St , Bldg . A , Austin , TX 78702-4490",0.502564442,Residence,"2204 Allred Dr, Austin, TX, 78748",W,11
1/2/20,07-B,NEW,Travis,Emmaline Cavet,60,0.4340278,Austin Travis County Integral,"1631 E 2nd St , Austin , TX 78702-4490",0.516370864,Residence,"2540 Lavendale Ct, Austin, TX, 78748",W,12
1/2/20,12-A,NEW,Travis,Brianne Thompkins,51,0.4375,Residence,"6705 W 290th Hwy #502 197, Austin, TX, 78735",0.519843064,Access Dental Orthodontics ( Au,"1923 E 7th St , Apt . 120 , Austin , TX 78702-3451",A,12
1/2/20,13-A,NEW,Travis,Zena Damrell,47,0.4597222,Residence,"7500 Rialto Blvd #250, Austin, TX, 78735",0.542065264,Blvd Dentistry & Orthodontics,"1920 E Riverside Dr , Apt . A-140 , Austin , TX 78741",A,12
1/2/20,04-B,NEW,Travis,Chevalier Boyne,52,0.4645833,Mars Methadone Clinic ( Austin-,"1110 W William Cannon Dr , Apt . 303 , Austin , TX 78745-5468",0.546926364,Residence,"1414 Larkwood Dr, Austin, TX, 78723",W,12
1/2/20,10-B,NEW,Travis,Kandy Stanyon,76,0.46875,Satellite Dialysis- Metric,"10000 Metric Blvd , Austin , TX 78758-5202",0.530507298,Residence,"15711 Dessau Rd #APT 904, Pflugerville, TX, 78660",A,9
1/2/20,08-B,NEW,Travis,Carolee Tremonte,50,0.50875,Peoples Community Clinic ( Aust,"1101 Camino La Costa , Austin , TX 78752-3930",0.625402674,Residence,"8600 N Fm 620, Austin, TX, 78726",A,17
1/2/20,09-B,NEW,Travis,Cord Tremathack,61,0.59875,Mars Methadone Clinic ( Austin-,"1110 W William Cannon Dr , Apt . 303 , Austin , TX 78745-5468",0.790883816,Residence,"17525 Bridgefarmer Blvd, Pflugerville, TX, 78660",A,28
1/2/20,12-B,NEW,Travis,Brianne Thompkins,51,0.59875,Access Dental Orthodontics ( Au,"1923 E 7th St , Apt . 120 , Austin , TX 78702-3451",0.681093064,Residence,"6705 W 290th Hwy #502 197, Austin, TX, 78735",A,12
1/2/20,13-B,NEW,Travis,Zena Damrell,47,0.59875,Blvd Dentistry & Orthodontics,"1920 E Riverside Dr , Apt . A-140 , Austin , TX 78741",0.681093064,Residence,"7500 Rialto Blvd #250, Austin, TX, 78735",A,12
1/2/20,14-B,NEW,Bell,Tiff Doveston,61,0.6322222,Austin Travis County Integral,"825 E Rundberg Ln , Apt . F , Austin , TX 78753-4808",0.94100869,Residence,"737 Mckay Ln, Salado, TX, 76571",A,45
1/2/20,11-B,NEW,Travis,Kilian Juzek,71,0.66875,Davita El Milagro,"2800 S I H 35 , Austin , TX 78704-5700",0.826574206,Residence,"14748 Olive Hill Dr, Austin, TX, 78717",A,23
1/2/20,16-B,CANCELED,Travis,Anders Charman,60,0,Blvd Dentistry & Orthodontics,"1920 E Riverside Dr , Apt . A-140 , Austin , TX 78741",0,Residence,"7009 Kenosha Pass, Austin, TX, 78749",A,11
1/2/20,17-B,CANCELED,Travis,Alessandro Ullett,83,0,Austin Travis County Integral,"825 E Rundberg Ln , Apt . F , Austin , TX 78753-4808",0,Residence,"6527 Fair Valley Trl, Austin, TX, 78749",W,18
1/2/20,15-A,CANCELED,Travis,Kelcie Crass,60,0.2881944,Residence,"8801 La Cresada Dr, Austin, TX, 78749",0.377399386,Access Dental Orthodontics ( Au,"1923 E 7th St , Apt . 120 , Austin , TX 78702-3451",A,13
1/2/20,16-A,CANCELED,Travis,Anders Charman,60,0.3854167,Residence,"7009 Kenosha Pass, Austin, TX, 78749",0.460897842,Blvd Dentistry & Orthodontics,"1920 E Riverside Dr , Apt . A-140 , Austin , TX 78741",A,11
1/2/20,15-B,CANCELED,Travis,Kelcie Crass,60,0.5208333,Access Dental Orthodontics ( Au,"1923 E 7th St , Apt . 120 , Austin , TX 78702-3451",0.610038286,Residence,"8801 La Cresada Dr, Austin, TX, 78749",A,13
1/2/20,17-A,CANCELED,Travis,Alessandro Ullett,83,0.5208333,Residence,"6527 Fair Valley Trl, Austin, TX, 78749",0.644347896,Austin Travis County Integral,"825 E Rundberg Ln , Apt . F , Austin , TX 78753-4808",W,18
date,trip_id,customer_name,trip_pickup_time,trip_pickup_name,trip_pickup_address,trip_dropoff_time,trip_dropoff_name,trip_dropoff_address,trip_los,trip_miles
1/2/20,01-A,Mona Stobo,0.15625,Residence,"2004 Tom Miller St, Austin, TX, 78723",0.231731142,Davita South Austin Dialysis,"6114 S First St , Austin , TX 78745-4008",A,11
1/2/20,02-A,Marieann Shalcros,0.1770833,Residence,"1800 Wheless Ln, Austin, TX, 78723",0.183945222,Satellite Healthcare Mueller,"1801 E 51st St , Apt . 100 , Bldg . G , Austin , TX 78723-3434",A,1
1/2/20,03-A,Trista Igonet,0.1979167,Residence,"5805 Sweeney Cir, Austin, TX, 78723",0.245950154,Austin Travis County Integral,"1631 E 2nd St , Bldg . A C & D , Austin , TX 78702-4490",A,7
1/2/20,04-A,Chevalier Boyne,0.2604167,Residence,"1414 Larkwood Dr, Austin, TX, 78723",0.342759764,Mars Methadone Clinic ( Austin-,"1110 W William Cannon Dr , Apt . 303 , Austin , TX 78745-5468",W,12
1/2/20,05-A,Jilly Golden,0.2708333,Residence,"2700 Aftonshire Way #B, Austin, TX, 78748",0.353176364,Austin Travis County Integral,"1631 E 2nd St , Bldg . D , Austin , TX 78702-4490",W,12
1/2/20,06-A,Freemon Flarity,0.2708333,Residence,"2204 Allred Dr, Austin, TX, 78748",0.346314442,Austin Travis County Integral,"1631 E 2nd St , Bldg . A , Austin , TX 78702-4490",W,11
1/2/20,07-A,Emmaline Cavet,0.28125,Residence,"2540 Lavendale Ct, Austin, TX, 78748",0.363593064,Austin Travis County Integral,"1631 E 2nd St , Austin , TX 78702-4490",W,12
1/2/20,08-A,Carolee Tremonte,0.3125,Residence,"8600 N Fm 620, Austin, TX, 78726",0.429152674,Peoples Community Clinic ( Aust,"1101 Camino La Costa , Austin , TX 78752-3930",A,17
1/2/20,09-A,Cord Tremathack,0.3125,Residence,"17525 Bridgefarmer Blvd, Pflugerville, TX, 78660",0.504633816,Mars Methadone Clinic ( Austin-,"1110 W William Cannon Dr , Apt . 303 , Austin , TX 78745-5468",A,28
1/2/20,01-B,Mona Stobo,0.3229167,Davita South Austin Dialysis,"6114 S First St , Austin , TX 78745-4008",0.398397842,Residence,"2004 Tom Miller St, Austin, TX, 78723",A,11
1/2/20,02-B,Marieann Shalcros,0.3229167,Satellite Healthcare Mueller,"1801 E 51st St , Apt . 100 , Bldg . G , Austin , TX 78723-3434",0.329778622,Residence,"1800 Wheless Ln, Austin, TX, 78723",A,1
1/2/20,10-A,Kandy Stanyon,0.3229167,Residence,"15711 Dessau Rd #APT 904, Pflugerville, TX, 78660",0.384673998,Satellite Dialysis- Metric,"10000 Metric Blvd , Austin , TX 78758-5202",A,9
1/2/20,03-B,Trista Igonet,0.34375,Austin Travis County Integral,"1631 E 2nd St , Bldg . A C & D , Austin , TX 78702-4490",0.391783454,Residence,"5805 Sweeney Cir, Austin, TX, 78723",A,7
1/2/20,11-A,Kilian Juzek,0.3645833,Residence,"14748 Olive Hill Dr, Austin, TX, 78717",0.522407506,Davita El Milagro,"2800 S I H 35 , Austin , TX 78704-5700",W,23
1/2/20,14-A,Tiff Doveston,0.36875,Residence,"737 Mckay Ln, Salado, TX, 76571",0.50753649,Austin Travis County Integral,"825 E Rundberg Ln , Apt . F , Austin , TX 78753-4808",A,45
1/2/20,05-B,Jilly Golden,0.4166667,Austin Travis County Integral,"1631 E 2nd St , Bldg . D , Austin , TX 78702-4490",0.499009764,Residence,"2700 Aftonshire Way #B, Austin, TX, 78748",W,12
1/2/20,06-B,Freemon Flarity,0.4270833,Austin Travis County Integral,"1631 E 2nd St , Bldg . A , Austin , TX 78702-4490",0.502564442,Residence,"2204 Allred Dr, Austin, TX, 78748",W,11
1/2/20,07-B,Emmaline Cavet,0.4340278,Austin Travis County Integral,"1631 E 2nd St , Austin , TX 78702-4490",0.516370864,Residence,"2540 Lavendale Ct, Austin, TX, 78748",W,12
1/2/20,12-A,Brianne Thompkins,0.4375,Residence,"6705 W 290th Hwy #502 197, Austin, TX, 78735",0.519843064,Access Dental Orthodontics ( Au,"1923 E 7th St , Apt . 120 , Austin , TX 78702-3451",A,12
1/2/20,13-A,Zena Damrell,0.4597222,Residence,"7500 Rialto Blvd #250, Austin, TX, 78735",0.542065264,Blvd Dentistry & Orthodontics,"1920 E Riverside Dr , Apt . A-140 , Austin , TX 78741",A,12
1/2/20,04-B,Chevalier Boyne,0.4645833,Mars Methadone Clinic ( Austin-,"1110 W William Cannon Dr , Apt . 303 , Austin , TX 78745-5468",0.546926364,Residence,"1414 Larkwood Dr, Austin, TX, 78723",W,12
1/2/20,10-B,Kandy Stanyon,0.46875,Satellite Dialysis- Metric,"10000 Metric Blvd , Austin , TX 78758-5202",0.530507298,Residence,"15711 Dessau Rd #APT 904, Pflugerville, TX, 78660",A,9
1/2/20,08-B,Carolee Tremonte,0.50875,Peoples Community Clinic ( Aust,"1101 Camino La Costa , Austin , TX 78752-3930",0.625402674,Residence,"8600 N Fm 620, Austin, TX, 78726",A,17
1/2/20,09-B,Cord Tremathack,0.59875,Mars Methadone Clinic ( Austin-,"1110 W William Cannon Dr , Apt . 303 , Austin , TX 78745-5468",0.790883816,Residence,"17525 Bridgefarmer Blvd, Pflugerville, TX, 78660",A,28
1/2/20,12-B,Brianne Thompkins,0.59875,Access Dental Orthodontics ( Au,"1923 E 7th St , Apt . 120 , Austin , TX 78702-3451",0.681093064,Residence,"6705 W 290th Hwy #502 197, Austin, TX, 78735",A,12
1/2/20,13-B,Zena Damrell,0.59875,Blvd Dentistry & Orthodontics,"1920 E Riverside Dr , Apt . A-140 , Austin , TX 78741",0.681093064,Residence,"7500 Rialto Blvd #250, Austin, TX, 78735",A,12
1/2/20,14-B,Tiff Doveston,0.6322222,Austin Travis County Integral,"825 E Rundberg Ln , Apt . F , Austin , TX 78753-4808",0.94100869,Residence,"737 Mckay Ln, Salado, TX, 76571",A,45
1/2/20,11-B,Kilian Juzek,0.66875,Davita El Milagro,"2800 S I H 35 , Austin , TX 78704-5700",0.826574206,Residence,"14748 Olive Hill Dr, Austin, TX, 78717",A,23
1/2/20,16-B,Anders Charman,0,Blvd Dentistry & Orthodontics,"1920 E Riverside Dr , Apt . A-140 , Austin , TX 78741",0,Residence,"7009 Kenosha Pass, Austin, TX, 78749",A,11
1/2/20,17-B,Alessandro Ullett,0,"1000 E 41st St, Austin, TX 78751","825 E Rundberg Ln , Apt . F , Austin , TX 78753-4808",0,Residence,"6527 Fair Valley Trl, Austin, TX, 78749",W,18
1/2/20,15-A,Kelcie Crass,0.2881944,Residence,"8801 La Cresada Dr, Austin, TX, 78749",0.377399386,Access Dental Orthodontics ( Au,"1923 E 7th St , Apt . 120 , Austin , TX 78702-3451",A,13
1/2/20,16-A,Anders Charman,0.3854167,Residence,"7009 Kenosha Pass, Austin, TX, 78749",0.460897842,Blvd Dentistry & Orthodontics,"1920 E Riverside Dr , Apt . A-140 , Austin , TX 78741",A,11
1/2/20,15-B,Kelcie Crass,0.5208333,Access Dental Orthodontics ( Au,"1923 E 7th St , Apt . 120 , Austin , TX 78702-3451",0.610038286,Residence,"8801 La Cresada Dr, Austin, TX, 78749",A,13
1/2/20,17-A,Alessandro Ullett,0.5208333,Residence,"6527 Fair Valley Trl, Austin, TX, 78749",0.644347896,Pharmacy,"1000 E 41st St, Austin, TX 78751",W,18

0 comments on commit aa66ce4

Please sign in to comment.