-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
102 lines (94 loc) · 4.3 KB
/
index.html
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<!DOCTYPE html>
<html ng-app="gen">
<head>
<meta charset="utf-8">
<title>Genetic Alg</title>
<link rel="stylesheet" href="css/bootstrap.min.css" media="screen" title="no title" charset="utf-8">
</head>
<body ng-controller="Main">
<div class="container">
<h1>Genetic</h1>
<div class="row">
<div class="col-md-12">
<table class="table table-hover">
<tr>
<th>#</th>
<th>Min</th>
<th>Max</th>
<th>Fitness</th>
</tr>
<tr ng-repeat="stat in statistic.min track by $index">
<td>
{{$index + 1}}
</td>
<td>
<input type="text" class="form-control" ng-model="statistic.min[$index]">
</td>
<td>
<input type="text" class="form-control" ng-model="statistic.max[$index]">
</td>
<td>
{{statistic.fitness[$index].toString()}}
</td>
</tr>
<tr>
<td></td><td>{{getTotal(statistic.min) | currency}}</td><td>{{getTotal(statistic.max) | currency}}</td>
</tr>
</table>
</div>
</div>
<div class="jumbotron">
<div class="input-group">
<input type="text" class="form-control" placeholder="Enter your budget" ng-model="budgetField">
<span class="input-group-addon"></span>
<input type="text" class="form-control" placeholder="Enter your size" ng-model="sizeField">
<span class="input-group-btn">
<button class="btn btn-primary" type="button" ng-click="startGen()">Calculate!</button>
</span>
</div>
</div>
<div class="jumbotron" ng-show="maxArray.length">
<h2>Max for iterations:</h2>
<p ng-repeat="m in maxArray track by $index">{{$index+1}} iteration: {{m}}</p>
</div>
<h2 ng-show="maxArray.length">Best result is</h2>
<div class="row" ng-show="maxArray.length">
<div class="col-md-12">
<table class="table table-hover">
<tr>
<th>#</th>
<th>Decimal</th>
<th>Binary</th>
<th>Fitness</th>
</tr>
<tr ng-repeat="b in best.decimals track by $index">
<td>
{{$index + 1}}
</td>
<td>
{{best.decimals[$index]}}
</td>
<td>
{{best.binaries[$index]}}
</td>
<td>
{{best.fitness[$index]}}
</td>
</tr>
<tr>
<td></td><td>{{getTotal(best.decimals) | currency}}</td><td></td><th>Effect is {{best.bigFit}}</th>
<!-- <td></td><td>{{getTotal(b.decimals) | currency}}</td><td></td><td>{{getTotal(b.fitness) | currency}}</td> -->
</tr>
</table>
</div>
</div>
<!-- <div class="jumbotron">
<h2>The best</h2>
</div> -->
</div>
<script src="js/angular.min.js" charset="utf-8"></script>
<script src="js/individual.js" charset="utf-8"></script>
<script src="js/population.js" charset="utf-8"></script>
<script src="js/main.js" charset="utf-8"></script>
</body>
</html>