- split = new Splitter("splitter");
- split->set_max_flow(8);
- entrada = new Conduct("entrada");
- entrada->set_max_flow(10);
-
- dren1 = new Drainage("drenaje1");
- dren2 = new Drainage("drenaje2");
-
- bomba1->connect(entrada, IConector::OUT);
- entrada->connect(bomba1, IConector::IN);
- entrada->connect(split, IConector::OUT);
- split->connect(entrada, IConector::IN);
- split->connect(salida1, IConector::OUT);
- split->connect(salida2, IConector::OUT);
- salida1->connect(split, IConector::IN);
- salida2->connect(split, IConector::IN);
- salida1->connect(dren1, IConector::OUT);
- salida2->connect(dren2, IConector::OUT);
-
- int i = 0;
- while (i<10) {
- bomba1->update();
- salida1->update();
- salida2->update();
- entrada->update();
- split->update();
- dren1->update();
- dren2->update();
-
- bomba1->simulate();
- salida1->simulate();
- salida2->simulate();
- entrada->simulate();
- split->simulate();
- dren1->simulate();
- dren2->simulate();
-
- sleep(1);
- if (i == 5) {
- bomba1->deactivate();
- }