Compare commits
No commits in common. "f536ca37fef620aec817cf0e05a8e63356808b33" and "f5382782324c1ccbec1490f9338057dae57dfda3" have entirely different histories.
f536ca37fe
...
f538278232
12
main.cpp
12
main.cpp
@ -3,15 +3,7 @@
|
||||
|
||||
#include "sa.hpp"
|
||||
|
||||
#ifndef TEMP
|
||||
#define TEMP 1000
|
||||
#endif
|
||||
|
||||
#ifndef ALPHA
|
||||
#define ALPHA 0.99
|
||||
#endif
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
int main()
|
||||
{
|
||||
int number_of_items = 0;
|
||||
int capacity = 0;
|
||||
@ -23,7 +15,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
sa::solution act = sa::solution::simulated_annealing(capacity, items,
|
||||
TEMP, ALPHA);
|
||||
1000, 0.99);
|
||||
|
||||
act.print_sol();
|
||||
}
|
||||
|
||||
7
run.sh
7
run.sh
@ -1,7 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
IFS=$'\n'
|
||||
|
||||
for file in $(find test -type f); do
|
||||
build/main.out < $file
|
||||
done
|
||||
2
sa.hpp
2
sa.hpp
@ -80,6 +80,7 @@ class solution {
|
||||
for (auto i : items) {
|
||||
if (now + i > capacity) {
|
||||
print_box(box_now, items_stored);
|
||||
std::cout << '\n';
|
||||
box_now++;
|
||||
now = i;
|
||||
} else {
|
||||
@ -89,7 +90,6 @@ class solution {
|
||||
}
|
||||
|
||||
print_box(box_now, items_stored);
|
||||
std::cout << '\n';
|
||||
}
|
||||
|
||||
static auto simulated_annealing(int capacity, const std::vector<long long> &items,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user