maintenance_problem_test.cpp 950 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
#include <iostream>
#include <fstream>
#include <cstdlib>

#include "./Specialization/LP_Problems/Maintenance_Problem.h"
#include "./Specialization/LP_Problems/maintenance_problem_generator.h"

int main(){

  maintenance_problem_generator mpg (
    random_graph_generator<CircSelectNodeFields, CircSelectEdgeFields>(
      {{Flow, Attribute(max, 0)}, {Demand, Attribute(fix, 0)}, {Capacity, Attribute(fix, 1)}, {Critical, Attribute(fix, 0)}},
      {},
14 15 16
      4,
      random_attribute_generator<CircSelectEdgeFields>({ {Capacity, {Integral, 0, 5}} }),
      4,
17 18
      random_attribute_generator<CircSelectNodeFields>({})
    ),
19
    3, 2
20 21 22 23 24 25
  );

  while(true){
    Maintenance_Problem mp;
    mpg >> mp;

26
    std::ofstream ofs("./.data/Maintenance_Problem/mp.lp");
27 28 29
    ofs << mp << std::endl;
    std::cout << mp << std::endl;
    ofs.close();
30

31 32 33 34 35
    system("polymake --script .data/Maintenance_Problem/pm_script_lp2facets");

    std::cin.ignore();
  }
}