import fr.lip6.printers.base;
import fr.lip6.printers.printers;

class Computer implements Equipment {
    Room room;
    Printer[] printers;

    boolean functional_printer = 
        exists ( printers.equipState, OK );

    boolean degraded_printer = 
        exists ( printers.equipState, Degraded );

    boolean working_printer = 
        exists ( [functional_printer, degraded_printer], true );

    t_degraded equipState dependson room.power.state {
      OK:  0.90, 0.09, 0.01;
      NOK: 0.00, 1.00, 0.00;
    };

    boolean can_print dependson equipState, working_printer {
	//	working_printer |         false                 | |              true             |
	//	equipState      | OK | Dysfunctional | Degraded | | OK | Dysfunctional | Degraded |
      /* false */        [0.50,    0.50,         0.50,      0.50,     0.50,         0.50,
      /* true  */         0.50,    0.50,         0.50,      0.50,     0.50,         0.50]
    };
}
