-
Notifications
You must be signed in to change notification settings - Fork 0
/
hillclimber.h
56 lines (44 loc) · 1019 Bytes
/
hillclimber.h
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef HILLCLIMBER
#define HILLCLIMBER
#include <stdlib.h>
#include <time.h>
#include "boolean.h"
#include "board.h"
#include "coordinate_struct.h"
#include "num_coordinates.h"
#include "output.h"
#include "distance.h"
#define NUMBER_OF_MOVES 8
#define NONE -9
void produce_random_solution(
struct Board *board,
struct Num_Coordinates *numbers);
void update_points(
struct Num_Coordinates *solution,
int *points,
int i,
int end);
void climb_hills(
struct Board *board,
struct Num_Coordinates *initial,
int *points,
int *iterations);
void process_deriviate_solutions(
struct Board *board,
struct Num_Coordinates *initial,
int *points,
int *iterations);
void swap_numbers(
struct Num_Coordinates *solution,
const int index_one,
const int index_two);
int find_number_to_swap(
const struct Board *board,
const struct Num_Coordinates *solution,
int index);
int assess_deriviate(
const struct Num_Coordinates *solution,
const int *points,
const int index_one,
const int index_two);
#endif