# Performance Analysis of a Forecasting Relocation Model for One-Way Carsharing
## 3 Methodology
### Simulation Input and Experimental Scenario
The vehicle availability at calling time \(t\) in departure station \(j\) is  
\[V_{j,t}=VPRESENT_{j,t}+\ VIN_{j,t}-VOUT_{j,t}\]  
where \(VPRESENT_{j,t}\) is the real number of parked vehicles in departure station \(j\) at time \(t\), \(VIN_{j,t}\) is the total number of vehicles scheduled to return to departure station \(j\) at time \(t\), and \(VOUT_{j,t}\) is the number of vehicles that are not available for use because they have been reserved (scheduled to be out) from departure station \(j\) at time \(t\). If \(V_{j,t}>\ 0\) (vehicle is available at the departure station) and \(AV\_SPACE_{k,t}>0\) (available space at the destination station), then the reservation decision will be accepted (\(DECISION_{i,t}\ \gets\ 1\)), otherwise it will be rejected. For an accepted reservation, starting from \(t\) until the simulation end of time, \(n\), \(VOUT_{j,t}\) has 1 added and \(AV\_SPACE_{k,t}\) has 1 subtracted. From the reservation \(i\) ending time, \(u\), until \(n\) simulation, \(VIN_{k,u}\) has 1 added, since the car is scheduled to  
Figure 5: Flow chart for reservation based one-way simulation. be away from station \(j\) at \(t\) and arrive at station \(k\) at \(u\) for this particular reservation. The system also reserves one space at the station \(k\), that starts from \(t\) for the reservation. (ii) \(RESERVATION\_EVENT_{i,t}=\) assign  
The system finds a car, \(d\), located in the departure station for reservation \(i\) at starting time \(h\), \((CURRENT\_STATION_{d,h}=DEPARTURE\_STATION\_ID_{i,h})\) with parked status \((VEHICLE\_STATUS_{d,h}=\)_parked_). The system randomly selects a parked car and assigns it to the particular reservation \((VEHICLE\_ID_{i,t}\gets d)\). Once the process finishes, the car status is changed from parked to booked, starting from \(t\) \((VEHICLE\_STATUS_{d,t}\leftarrow\) booked) until \(n\)\((VEHICLE\_STATUS_{d,n}\leftarrow\) booked). The car status is changed to booked to prevent the car from being assigned to another reservation until the status of that particular car changes to parked again. (iii) \(RESERVATION\_EVENT_{i,t}=\) starting  
Starting from \(t\) until \(n\), \(VOUT_{j,t}\) and \(VPRESENT_{j,t}\) at departure station \(j\) are decreased by 1, and \(AV\_SPACE_{j,t}\) is increased by 1. At \(t\), the car is no longer scheduled to be OUT or parked, but is being driven by the customer. The system also adds one available space at the departure station when the car leaves at \(t\). Thus, the car status is changed from booked to on the road from \(t\) until \(n\)\((VEHICLE\_STATUS_{d,n}\leftarrow\)_onroad_). (iv) \(RESERVATION\_EVENT_{i,t}=\) ending  
Once the customer trip ends, the system increments the parked cars at destination station \(k\) by 1, from \(t\) until \(n\). The system also decreases \(VIN\) by 1 at the destination station from \(t\) until \(n\). The car is not scheduled to arrive at the destination station at some future time, because it has already arrived at the destination station. The car status is also changed from on road to parked \((VEHICLE\_STATUS_{d,t}\leftarrow\) parked) and its current location is updated to the destination station \((CURRENT\_STATION_{d,t}\gets k)\)\(t\) until \(n\). (v) \(RESERVATION\_EVENT_{i,t}=\) relocation  
The system implements the relocation model, relocating a number of cars, \(u\), from an overstocked station \(j\) to an under stocked station \(k\) based on their relocation type \((CURRENT\_STATION_{u,t}\gets k)\). The matrices were implemented as multidimensional arrays in the C++ programming language, ensuring that simulation performance was maximized. At time \(n\), the simulation shows an average car utilization ratio, reservation acceptance ratio, and relocation cost for a given scenario. Different scenarios were implemented for the total number of cars, number of reservations, and relocation type. The simulation results were then collected for analysis and performance evaluation.