Skip to content

Commit 378904d

Browse files
committed
many improvements
1 parent f14e2e6 commit 378904d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+207
-114
lines changed

overlapping-model/cell.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,17 @@ class Cell {
1111
}
1212
}
1313
}
14+
entropy() {
15+
let wt_sum = this.options
16+
.map((i) => tiles[i].freq)
17+
.reduce((a, b) => a + b, 0);
18+
return (
19+
Math.log2(wt_sum) -
20+
(1 / wt_sum) *
21+
this.options
22+
.map((i) => tiles[i].freq)
23+
.map((wt) => wt * Math.log2(wt))
24+
.reduce((a, b) => a + b, 0)
25+
);
26+
}
1427
}

overlapping-model/index.html

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
<!DOCTYPE html>
22
<html lang="en">
33
<head>
4-
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.js"></script>
4+
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/p5.js"></script>
55
<meta charset="utf-8" />
66
<title>Wave Function Collapse</title>
7-
<style>
8-
body {
9-
background-color: #555;
10-
}
11-
</style>
7+
<style></style>
128
</head>
139

1410
<body>

overlapping-model/samples/3Bricks.png

351 Bytes

overlapping-model/samples/Angular.png

179 Bytes
315 Bytes

overlapping-model/samples/Cat.png

262 Bytes

overlapping-model/samples/Cats.png

260 Bytes

overlapping-model/samples/Cave.png

168 Bytes

overlapping-model/samples/Chess.png

106 Bytes

overlapping-model/samples/Circle.png

320 Bytes

0 commit comments

Comments
 (0)