34 lines
550 B
C++
34 lines
550 B
C++
#include <iostream>
|
|
#include <vector>
|
|
|
|
#include "sa.hpp"
|
|
|
|
#ifndef TEMP
|
|
#define TEMP 1000
|
|
#endif
|
|
|
|
#ifndef ALPHA
|
|
#define ALPHA 0.99
|
|
#endif
|
|
|
|
#ifndef TEMP_MIN
|
|
#define TEMP_MIN 0.01
|
|
#endif
|
|
|
|
int main()
|
|
{
|
|
int number_of_items = 0;
|
|
int capacity = 0;
|
|
std::cin >> number_of_items >> capacity;
|
|
|
|
std::vector<long long> items(number_of_items);
|
|
for (auto &i : items) {
|
|
std::cin >> i;
|
|
}
|
|
|
|
sa::solution act = sa::solution::simulated_annealing(capacity, items,
|
|
ALPHA, TEMP, TEMP_MIN);
|
|
|
|
act.print_sol();
|
|
}
|