Commit 5b3c57cc authored by Jonas Seidel's avatar Jonas Seidel

various minor syncing

parent a3fc2648
......@@ -60,17 +60,13 @@ for (@$integral_indexes) {
push @$restr_labels, @$labels[$_];
}
#print scalar @$labels; print "\n";
#print scalar @$integral_indexes; print "\n";
#print scalar @$restr_labels; print "\n";
#print "@$labels\n";
#print "@$restr_labels\n";
# calculating the wanted data:
print "Mixed Integer Convex Hull:\n";
my $mint_hull = mixed_integer_hull($import, $integral_indexes);
$mint_hull->COORDINATE_LABELS = $import->COORDINATE_LABELS;
print_constraints($mint_hull);
#print "Mixed Integer Convex Hull:\n";
#my $mint_hull = mixed_integer_hull($import, $integral_indexes);
#$mint_hull->COORDINATE_LABELS = $import->COORDINATE_LABELS;
#print_constraints($mint_hull);
print "Integral Coordinate Projection Convex Hull\n";
my $proj = projection($import, $integral_indexes);
......@@ -78,11 +74,6 @@ my $proj_hull = integer_hull($proj);
$proj_hull->COORDINATE_LABELS = $restr_labels;
print_constraints($proj_hull);
#print "check: Integral Coordinate Projection of MI Convex Hull\n";
#my $mint_proj_hull = integer_hull(projection($mint_hull, $integral_indexes));
#$mint_proj_hull->COORDINATE_LABELS = $restr_labels;
#print_constraints($mint_proj_hull);
#print "\n\n---------------------------------------------------------------------------------------------------------\n";
#print "Extreme points of lattice points convex hull:\n\n";
......
......@@ -8,3 +8,4 @@ maintenance_problem_test
.test
*.lp
*.netw
*.log
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <cassert>
#include <vector>
#include "./Specialization/LP_Problems/Maintenance_Problem.h"
#include "./Specialization/LP_Problems/maintenance_problem_generator.h"
int main(){
int main(int argc, char** argv){
Maintenance_Problem mp;
maintenance_problem_generator mpg (
random_graph_generator(
4,
4,
random_attribute_generator({ {"Upper", {fix, Integral, 1, 5}} }),
700,
500,
random_attribute_generator({ {"Upper", {fix, Integral, 1, 100}} }),
random_attribute_generator({}),
{{"Flow", Attribute(max, 0)},{"Upper", Attribute(fix, 1)}, {"Selected", Attribute(fix, 0)}}
),
3, 2
500, 5
);
if(argc > 1){
std::ifstream graph_stream (argv[1]);
Graph g (graph_stream);
std::vector<Node*> sources = g.select_sources();
std::vector<Node*> targets = g.select_targets();
assert(sources.size() == 1);
assert(targets.size() == 1);
mp = Maintenance_Problem(g, sources[0], targets[0], std::atoi(argv[2]));
goto jmp;
}
while(true){
system("killall graph_display");
Maintenance_Problem mp;
mpg >> mp;
mp = mpg.next(100,1);
jmp:
std::ofstream ofs_graph("./.data/Maintenance_Problem/mp.netw");
ofs_graph << mp.network() << std::endl;
ofs_graph.close();
system("cd ../display/graph_display/ && (./graph_display --file ../../discrete_optimization_library/.data/Maintenance_Problem/mp.netw &) && cd ../../discrete_optimization_library");
//system("cd ../display/graph_display/ && (./graph_display --file ../../discrete_optimization_library/.data/Maintenance_Problem/mp.netw &) && cd ../../discrete_optimization_library");
std::cout << "starting write" << std::endl;
std::ofstream ofs_program("./.data/Maintenance_Problem/mp.lp");
ofs_program << mp << std::endl;
std::cout << mp << std::endl;
ofs_program.close();
system("polymake --script .data/Maintenance_Problem/pm_script_lp2facets");
//system("polymake --script .data/Maintenance_Problem/pm_script_lp2facets");
exit(0);
std::cin.ignore();
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment