Commit 07067752 authored by jonas's avatar jonas
Browse files

utils for determining win percentage of given solving method

parent 50ea70df
......@@ -40,4 +40,5 @@ share-of-critical_dummy_edge_compensated
nincidences_dummy_simple
nincidences_dummy_non_simple
nedges_dummy_cut_networks
nsteps_dummy_multiple_sources
thread_test
......@@ -24,17 +24,21 @@ struct SCIP_ProbData{
static
SCIP_RETCODE del_prob_data (SCIP* scip, SCIP_PROBDATA** probdata){
std::cout << "test1" << std::endl;
SCIP_ProbData** prob_data = (SCIP_ProbData**) probdata;
for(int index = 0; index < (*prob_data)->nepochs; ++index){
std::cout << index << std::endl;
SCIPfree(&(*prob_data)->subproblems[index]);
}
std::cout << "ptr array" << std::endl;
SCIPfreeBlockMemoryArray(scip, &(*prob_data)->subproblems, (*prob_data)->nepochs);
std::cout << "data" << std::endl;
SCIPfreeBlockMemory(scip, probdata);
return SCIP_OKAY;
std::cout << "test2" << std::endl;
}
......
#include <fstream>
#include <vector>
#include <filesystem>
#include "../../../Specialization/LP_Problems/Maintenance_Problem/Testing/maintenance_problem_testing.h"
// make sure the requested models actually exist in the parsed data. Otherwise this in csv(...) at the latest.
int main(int argc, char** argv){
assert(argc == 4);
std::filesystem::path top_level_path(argv[1]);
std::string modela(argv[2]);
std::string modelb(argv[3]);
std::vector<Data> data_vector;
gather_data(top_level_path, data_vector);
size_t win_counter = 0;
size_t counter = 0;
for(Data data : data_vector){
auto modela_search = data.derived_performance.find(modela);
auto modelb_search = data.derived_performance.find(modelb);
assert(modela_search != data.derived_performance.end());
assert(modelb_search != data.derived_performance.end());
auto modela_perf_vec = modela_search->second;
auto modelb_perf_vec = modelb_search->second;
assert(modela_perf_vec.size() == 1);
assert(modelb_perf_vec.size() == 1);
if(modela_perf_vec[0].time_in_sec > modelb_perf_vec[0].time_in_sec){
++win_counter;
}
++counter;
}
std::cout << "modela wins " << (double)win_counter/counter*100 << "% of the times" << std::endl;
}
......@@ -7,7 +7,7 @@ exec=$(find -wholename "./mk_tests/*" | grep -E -v '(.cpp|.o)$')
echo "tests loaded:"
echo "${exec}"
let count=0
let count=1
mkdir data
mkdir data/test_data
......@@ -33,7 +33,7 @@ while [ $count -lt 200 ]; do
echo "executing $test data/test_data/$test_filename $count";
bash -c "$test data/test_data/$test_filename $count > >(tee -a all_exec.log) 2> >(tee -a stderr.log >&2)"
echo "executing ./mk_utils/gather_data_to_csv data/test_data/$test_filename $columns ${models[*]}"
bash -c "./mk_utils/gather_data_to_csv data/test_data/$test_filename $columns ${models[*]} -o data/test_data/$test_filename/$test_filename.csv 2> >(tee -a stderr.log >&2)"
bash -c "./mk_utils/gather_data_to_csv data/test_data/$test_filename $columns ${models[*]} -o ./out/$test_filename 2> >(tee -a stderr.log >&2)"
done
make push
......
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