Opportunistic and time-based preventive maintenance jointly optimized. Non-homogeneous opportunity arrivals and stochastic durations considered. “Partial” opportunities considered for the first time. Opportunity duration thresholds used as a decision criterion. Numerical study conducted to evaluate benefit of optimized policy.