-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlocalSearch.h
More file actions
40 lines (33 loc) · 1.14 KB
/
localSearch.h
File metadata and controls
40 lines (33 loc) · 1.14 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
37
38
39
40
#pragma once
#include "Alignment.h"
#include "Network.h"
#include <random>
#include <vector>
void correctHillClimb(RandGenT& prng, Alignment* aln, bool total,
int maxIters, const vector<fitnessName>& fitnessNames,
int obj = -1);
void proportionalSearch(RandGenT& prng, Alignment* aln, bool total,
int iters, const vector<fitnessName>& fitnessNames,
int obj, double proportion);
//this does a swap, computes the % change in each objective,
//undoes the swap, and reports the length of the % change vector
double swapNormalizedDelta(Alignment& aln, const vector<fitnessName>&
fitnessNames, node x, node y);
void steepestAscentHillClimb(Alignment* aln,
vector<fitnessName>& fitnessNames,
int nthreads, bool verbose);
/*
void potentialBasedSearch(RandGenT& prng, Alignment* aln, bool total,
int iters, const vector<string>& fitnessNames,
bool bit);
*/
class VelocityTracker{
public:
VelocityTracker();
void reportDelta(const vector<double>& in);
vector<double> getRecentVel() const;
private:
int nextSpot;
int size;
vector<vector<double> > recentDeltas;
};