Vehicle Arrival A27921
1. **Problem statement:** Simulate 1000 vehicles arriving at an intersection on a primary road following a translated negative exponential distribution with average arrival rate $\lambda=0.2$ veh/sec and minimum headway uniformly distributed around mean 2 seconds with range 1 second. Determine minimum headway, arrival headway, and arrival time for all vehicles.
2. **Formulas and rules:**
- Minimum headway $t_m$ is uniformly distributed: $t_m = 2 \pm 0.5$ seconds (range 1 second means $\pm 0.5$ around mean 2).
- Translated arrival rate: $$\lambda' = \frac{\lambda}{1 - \lambda t_m}$$
- To generate exponential headway $h$ from uniform random variable $u \sim U(0,1)$: $$h = -\frac{\ln(u)}{\lambda'}$$
- Arrival headway $H = t_m + h$.
- Arrival time for vehicle $i$: $$T_i = \sum_{k=1}^i H_k$$
3. **Step-by-step solution:**
- For each vehicle $i$ from 1 to 1000:
1. Generate $u_i$ uniformly in [0,1].
2. Generate minimum headway $t_{m,i}$ uniformly in [1.5, 2.5] seconds.
3. Compute $\lambda'_i = \frac{0.2}{1 - 0.2 \times t_{m,i}}$.
4. Compute exponential headway $h_i = -\frac{\ln(u_i)}{\lambda'_i}$.
5. Compute arrival headway $H_i = t_{m,i} + h_i$.
6. Compute arrival time $T_i = T_{i-1} + H_i$ with $T_0=0$.
4. **Explanation:**
- The minimum headway $t_m$ ensures a safety gap between vehicles.
- The translated negative exponential distribution models the random arrival times shifted by $t_m$.
- Using the uniform random variable $u$ and the formula for $h$ generates the exponential component of the headway.
- Summing headways gives cumulative arrival times.
**Final answer:** The minimum headway, arrival headway, and arrival time for each vehicle $i$ are computed as above for $i=1$ to 1000.