+*/
+
+
+ // TRATANDO DE HACER ANDAR AL UNION
+ Pump *p1, *p2;
+ Conduct *c1, *c2, *c3;
+ Drainage *d1;
+ Union *u1;
+
+ p1 = new Pump("Bomba 1");
+ p1->set_max_flow(100);
+ p2 = new Pump("Bomba 2");
+ p2->set_max_flow(100);
+ c1 = new Conduct("Para B1");
+ c1->set_max_flow(3);
+ c2 = new Conduct("Para B2");
+ c2->set_max_flow(4);
+ c3 = new Conduct("Salida");
+ c3->set_max_flow(6);
+ d1 = new Drainage("Drenaje");
+ u1 = new Union("Union");
+ u1->set_max_flow(5);
+
+ p1->connect(c1, IConector::OUT);
+ p2->connect(c2, IConector::OUT);
+ c1->connect(p1, IConector::IN);
+ c2->connect(p2, IConector::IN);
+
+ u1->connect(c1, IConector::IN);
+ u1->connect(c2, IConector::IN);
+ c1->connect(u1, IConector::OUT);
+ c2->connect(u1, IConector::OUT);
+
+ u1->connect(c3, IConector::OUT);
+ c3->connect(u1, IConector::IN);
+
+ c3->connect(d1, IConector::OUT);
+ d1->connect(c3, IConector::IN);
+
+ int i = 0;
+ while (i<8) {
+ p1->update();
+ p2->update();
+ c1->update();
+ c2->update();
+ c3->update();
+ d1->update();
+ u1->update();
+
+ p1->simulate();
+ p2->simulate();
+ c1->simulate();
+ c2->simulate();
+ c3->simulate();
+ d1->simulate();
+ u1->simulate();
+
+ sleep(1);
+ if (i == 3) {
+ p2->deactivate();
+ }
+ if (i == 6) {
+ p1->deactivate();
+ }
+ i++;
+ }
+