Skip to content

Commit

Permalink
<update><docs> illustration of data structure
Browse files Browse the repository at this point in the history
  • Loading branch information
QiuziChen committed Aug 9, 2023
1 parent 087a725 commit 34b9ee8
Showing 1 changed file with 24 additions and 15 deletions.
39 changes: 24 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This project provides an **Adaptive Large Neighborhood Search (ALNS)** framework for (single depot & charging station) **electric vehicle scheduling problem (EVSP)**.

Package requirements, data structure and details of algorithm design will be introduced below. A simple tutorial will help you better understand how to use the framework to solve EVSP and extend it by designing your own destroy and repair operators.
Data structure and details of algorithm design will be introduced below. A simple tutorial will help you better understand how to use the framework to solve EVSP and extend it by designing your own destroy and repair operators.

# Table of Contents

Expand All @@ -11,7 +11,6 @@ Package requirements, data structure and details of algorithm design will be int
- [1.1 EVSP](#11-evsp)
- [1.1.1 Problem Description](#111-problem-description)
- [1.1.2 Assumptions](#112-assumptions)
- [1.1.3 Notations](#113-notations)
- [1.2 ALNS](#12-alns)
- [2 Structure of the framework](#2-structure-of-the-framework)
- [2.1 Data structure](#21-data-structure)
Expand All @@ -29,7 +28,7 @@ Package requirements, data structure and details of algorithm design will be int

# 1 Background knowledge

> Detailed information and explanation of the model and algorithm can be found in my article <https://doi.org/10.1016/j.trd.2023.103724>.
> Detailed information and explanation of the model and algorithm can be found in my article: <https://doi.org/10.1016/j.trd.2023.103724>.
## 1.1 EVSP

Expand All @@ -43,26 +42,30 @@ Package requirements, data structure and details of algorithm design will be int

3. **Fully night charging**: Vehicles will be fully charged at the depot after finishing all tasks for the day to ensure that vehicles have enough power for the next day’s operation. Charging resources at the depot are assumed sufficient.

### 1.1.3 Notations

## 1.2 ALNS

# 2 Structure of the framework

## 2.1 Data structure

The framework uses three class to store the data of an EVSP, including

- `EVSP`: containing timetable and network parameters of an EVSP.
- `Duty`: containing information of a trip chain (a schedule of one single bus).
- `Schedule`: containing information of the schedule of the day.

### 2.1.1 `EVSP`

An EVSP object is used to initialize and store the *timetable* and *network params*. Users should first initialize an EVSP object with the timetale and operating params. Then use functions to input other information.

- `__init__()`: Initialize function, including the following attributes:
- `timetable`
- `batteryLB`
- `batteryUB`
- `stationCap`
- `delta`
- `U`
- `lineChange`
- `__init__()`: initialize function, including the following attributes:
- `timetable`: start time, travel time and energy consumption of each trip
- `batteryLB`: lower safe bound of battery remaining level (0.0-1.0)
- `batteryUB`: upper safe bound of battery remaining level (0.0-1.0)
- `stationCap`: number of chargers in the station
- `delta`: time interval
- `U`: the number of interval in a fixed charging duration
- `lineChange`: whether linechange is allowed, which means a bus can serve several lines in a day

- `setVehTypes()`: Set vehicle types info, including battery capacity dict `E_k`. If users want to consider capacity-related consumptions, then set `capRelatedCons=True`, define bench capacity `benchCap` and consumption increasing rate `consIncRate` ($kWh\cdot km^{-1} / kWh$). Note that this consideration is based on the assumption that energy consumption rate of different veh types is linearly related to battery capaicty. A default value is provided referring to existing study.
- `setCosts()`: Set costs, including vehicle cost `c_k`, electricity cost `c_e` and labor (time-related) cost `c_t`. The labor or time-related cost is assume fixed. *Time-of-Use policy is not yet available.*
Expand All @@ -77,7 +80,7 @@ A Duty object storage the schedule of a single bus including trip nodes, chargin

- `__init__()`: A Duty object is initialized with the following parameters:
- `evsp`
- `type`
- `type`: vehicle type
- `tripChain`
- `chargingTime`
- `checkEnergyFeasibility()`: Return True if a duty can meet the energy constraint.
Expand All @@ -94,7 +97,13 @@ A Schedule object consists of a series of vehicles with their service trips and
- `addDuty`, `delDuty`, `sortDuty`
- `addR`, `delR`, `updateR`
- `checkEnergyFeasibility`
-
- `checkCapacityFeasibility`
- `calCost`: Calculate the cost of a schedule.
- `printTimetable`: Print timetable as in the form of dataframe.
- `plotTimetable`: Plot timetable as an image.
- `costBar`: Return a barplot of each item of cost.
- `chargingPowerPlot`: Display the variation of charging power at the station.
- `chargingUsagePlot`: Display the variation of the number of buses in the charging station.

## 2.2 Algorithm components

Expand Down

0 comments on commit 34b9ee8

Please sign in to comment.