# Performance Analysis of a Forecasting Relocation Model for One-Way Carsharing
## 3 Methodology
### Simulation Input and Experimental Scenario  
The trip generator generates three matrices from the data distributions: reservation data, vehicle data, and station data. Customer reservation data is presented as \(\mathbf{R}_{m\ x\ n}\), where \(m\) is the total number of reservations, and \(n\) is the total hours of simulation, e.g.,  
\[\mathbf{R}_{m\ x\ n}=\left[ \begin{array}{cccccc}\{\mathit{calling},0,6,9,4,7, 0\}&\{0,0,0,0,0,0,0,\}&\{\mathit{assign},0,6,9,4,7,0\}&\{\mathit{starting},0,6,9,4,7,0\}&\ldots&r_{1,n}\\ \{0,0,0,0,0,0\}&\{0,0,0,0,0,0\}&\{\mathit{calling},0,2,4,6,8,0\}&\{\mathit{ assigng},0,2,4,6,8,0\}&\ldots&r_{2,n}\\ \{0,0,0,0,0,0\}&\{0,0,0,0,0,0,0\}&\{\mathit{calling},0,8,5,7,9,0\}&\{0,0,0,0,0,0 \}&\ldots&r_{3,n}\\ \ldots&\ldots&\ldots&\ldots&\ldots&\ldots\\ r_{m,1}&r_{m,2}&r_{m,3}&r_{m,4}&\ldots&r_{m,n}\end{array} \right]\]  
where \(r_{1,1}=\{\mathit{calling},\ 0,\ 6,\ 9,\ 4,\ 7,\ 0\}\) represents \(\{\mathit{RESERVATION\_EVENT},\mathit{DECISION},\mathit{DEPARTURE\_STATION\_ID},\mathit{ DESTINATION\_STATION\_ID},\mathit{STARTING\_TIME},\mathit{ENDING\_TIME},\mathit{ VEHICLE\_ID}\}\), respectively. Thus, the above case means that the customer made a reservation (calling) to the system to request a car from station id 6 at the 4 th hour to station id 9 at the 7 th hour. In our study, the full hour reservation made by customers is assumed. The default \(\mathit{DECISION}\) is always initialized to 0. Station data is presented as \(\mathbf{S}_{q\ x\ n}\), where \(q\) is the number of stations, and \(n\) is the number of hours for the simulation, e.g.,  
\[\mathbf{S}_{q\ x\ n}=\left[ \begin{array}{cccccc}\{1,25,0,0,10,15\}&\{1,25,0, 0,10,15\}&\{1,25,0,0,10,15\}&\ldots&s_{1,n}\\ \{2,30,0,0,20,10\}&\{2,30,0,0,20,10\}&\{2,30,0,0,20,10\}&\ldots&s_{2,n}\\ \{3,20,0,0,10,10\}&\{3,20,0,0,10,10\}&\{3,20,0,0,10,10\}&\ldots&s_{3,n}\\ \ldots&\ldots&\ldots&\ldots&\ldots&\ldots\\ s_{q,1}&s_{q,2}&s_{q,3}&\ldots&s_{q,n}\end{array} \right]\]  
where \(s_{1,1}=\{1,25,0,0,10,15\}\) represents \(\{\mathit{STATION\_ID},\mathit{TOTAL\_LOTS},\mathit{VIN},\mathit{VOUT},\mathit{ VPRESENT},\mathit{AV\_SPACE}\}\), respectively. Thus, this entry means that initially station ID 1 has 25 lots, there is no car expected to come in (VIN) or go out (VOUT) from this particular station, the total of parked cars (VPRESENT) is 10, and the available space (AV_SPACE) is 15. Finally, the vehicle data is presented as \(\mathbf{V}_{p\ x\ n}\), where \(p\) is the number of vehicles, and \(n\) is the number of hours for the simulation, e.g.,  
\[\mathbf{V}_{p\ x\ n}=\left[ \begin{array}{cccccc}\{1,parked,1\}&\{1,parked,1 \}&\{1,parked,1\}&\ldots&v_{1,n}\\ \{2,parked,1\}&\{2,parked,1\}&\{2,parked,1\}&\ldots&v_{2,n}\\ \{50,parked,7\}&\{50,parked,7\}&\{50,parked,7\}&\ldots&v_{50,n}\\ \ldots&\ldots&\ldots&\ldots&\ldots\\ v_{p,1}&v_{p,2}&v_{p,3}&\ldots&v_{p,n}\end{array} \right]\]  
where \(v_{1,1}=\{1,parked,1\}\) represents \(\{\mathit{VEHICLE\_ID},\mathit{VEHICLE\_STATUS},\mathit{CURRENT\_STATION}\}\), respectively. Thus, this entry means that at the initial time vehicle id 1 was parked at station ID 1. The simulation program reads the reservation data from the earliest to the last hour of the simulation. The program checks the RESERVATION_EVENT (calling, assign, starting, ending, or relocation) and does the task based on the identified event. Figure 5 shows the simulation flowchart. The program checks \(RESERVATION\_EVENT_{i,t}\), the event status of reservation \(i\) at time \(t\). There are five possible cases for reservation status (\(RESERVATION\_EVENT\)), as follows. (i) \(RESERVATION\_EVENT_{i,t}=\) calling  
The system calculates the vehicle availability from the departure station and lot availability in the destination station.