Condition-based maintenance for complex systems