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

  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();
30

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

    std::cin.ignore();
  }
}