maintenance_problem_test.cpp 953 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
#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)}},
      {},
      3,
      random_attribute_generator<CircSelectEdgeFields>({ {Capacity, {Continuous, 0, 5}} }),
      4,
      random_attribute_generator<CircSelectNodeFields>({})
    ),
    2, 2
  );

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

    std::ofstream ofs("./.data/Maintenance_Problem/mp");
    ofs << mp << std::endl;
    std::cout << mp << std::endl;
    ofs.close();
    
    system("polymake --script .data/Maintenance_Problem/pm_script_lp2facets");

    std::cin.ignore();
  }
}