This repository was archived by the owner on Jan 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsa.h
More file actions
36 lines (26 loc) · 1.4 KB
/
sa.h
File metadata and controls
36 lines (26 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef __SA_H__
#define __SA_H__
#include <math.h>
#include "heur.h"
struct simulated_annealing_state
{
double T; // Temperatura
double t0; // Initial temperature
double a; // Coef de resfriamento
double eps; // Epsilon checks
size_t max_iter; // max iterations
};
double sa_randf (void);
double sa_prob (struct simulated_annealing_state sa,
double delta);
double sa_acceptable (struct simulated_annealing_state sa,
double delta);
double sa_initial_temperature (struct matrix * M,
size_t evals);
struct solution * sa_minimize (struct simulated_annealing_state sa,
struct solution * S,
struct matrix * M);
struct solution * sa_maximize (struct simulated_annealing_state sa,
struct solution * S,
struct matrix * M);
#endif /* __SA_H__ */