#include "exclusa.h"
#include <unistd.h>
#include <iostream>
-#include "simulador.h"
+#include "simulator.h"
using namespace std;
using namespace PlaQui::Model;
int main(int argc, char *argv[])
{
- Simulador *sim = new Simulador();
-
- sim->add_pump("bomba1");
- sim->add_conduct("c");
- sim->add_conduct("c1");
- sim->add_drainage("d");
- sim->add_tank("tanque");
-
- sim->connect("bomba1", "c", IConector::OUT);
- sim->connect("c", "tanque", IConector::OUT);
- sim->connect("tanque", "c1", IConector::OUT);
- sim->connect("c1", "d", IConector::OUT);
+ Simulator *sim = new Simulator(argv[1]);
int i=0;
- while (i<10) {
- sim->simulate();
- if (i == 4) {
- if (!sim->pump_deactivate("bomba1")) {
- std::cout << "c no es pump :-)" << std::endl;
- }
+ while (i<5) {
+ if (i==1) {
+ sim->set_open("exclusa6", false);
+ std::cout << "apagando" << std::endl;
}
i++;
+ sim->simulate();
+ std::cout << sim->get_state_as_xml() << std::endl << std::endl;
}
delete sim;