Reliability Analysis and Optimization of Systems Containing Multi-Functional Entities