-
Notifications
You must be signed in to change notification settings - Fork 3
/
tests.txt
76 lines (61 loc) · 2.91 KB
/
tests.txt
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
zero-turtles-and-one-cluster-causes-error
extensions [ k-means ]
k-means:cluster-by-xy turtles 1 100 0.1 => ERROR Extension exception: Not enough turtles to form the requested number of clusters.
zero-turtles-and-zero-clusters-results-in-empty-list
extensions [ k-means ]
k-means:cluster-by-xy turtles 0 100 0.1 => []
zero-clusters-and-five-turtles-results-in-empty-list
extensions [ k-means ]
O> crt 5
k-means:cluster-by-xy turtles 0 100 0.1 => []
only-one-cluster-requires-no-clustering
extensions [ k-means ]
O> crt 5
map count k-means:cluster-by-xy turtles 1 100 0.1 => [5]
fewer-turtles-than-clusters-same-location
extensions [ k-means ]
O> crt 5
k-means:cluster-by-xy turtles 10 100 0.1 => ERROR Extension exception: Not enough turtles to form the requested number of clusters.
fewer-turtles-than-clusters-distinct-locations
extensions [ k-means ]
O> ask n-of 5 patches [ sprout 1 ]
k-means:cluster-by-xy turtles 10 100 0.1 => ERROR Extension exception: Not enough turtles to form the requested number of clusters.
same-number-of-turtles-as-clusters-same-location
extensions [ k-means ]
O> crt 5
k-means:cluster-by-xy turtles 5 100 0.1 => ERROR Extension exception: Not enough turtles at distinct locations to form the requested number of clusters.
same-number-of-turtles-as-clusters-distinct-locations
extensions [ k-means ]
O> ask n-of 5 patches [ sprout 1 ]
map count k-means:cluster-by-xy turtles 5 100 0.1 => [1 1 1 1 1]
one-more-turtle-than-clusters-same-location
extensions [ k-means ]
O> crt 6
k-means:cluster-by-xy turtles 5 100 0.1 => ERROR Extension exception: Not enough turtles at distinct locations to form the requested number of clusters.
one-more-turtle-than-clusters-distinct-locations
extensions [ k-means ]
O> ask n-of 6 patches [ sprout 1 ]
sort map count k-means:cluster-by-xy turtles 5 100 0.1 => [1 1 1 1 2]
twice-as-many-turtles-than-clusters-distinct-locations
extensions [ k-means ]
O> ask n-of 10 patches [ sprout 1 ]
length k-means:cluster-by-xy turtles 5 100 0.1 => 5
a-thousand-turtles
extensions [ k-means ]
O> crt 1000 [ setxy random-xcor random-ycor ]
length k-means:cluster-by-xy turtles 100 100 0.1 => 100
order-of-returned~clusters-is-random
extensions [ k-means ]
O> ask n-of 2 patches [ sprout 1 ]
length remove-duplicates n-values 32 [ k-means:cluster-by-xy turtles 2 100 0.1 ] => 2
two-clusters-of-two-turles
extensions [ k-means ]
O> ask patch -5 0 [ sprout 2 ]
O> ask patch 5 0 [ sprout 2 ]
(word remove-duplicates map [ sort map [ (word sort [ who ] of ?) ] ? ] n-values 32 [ k-means:cluster-by-xy turtles 2 100 0.1 ]) => "[[[0 1] [2 3]]]"
links-blow-up
extensions [ k-means ]
k-means:cluster-by-xy links 5 100 0.1 => ERROR Extension exception: Expected input to be a turtle set.
patches-blow-up
extensions [ k-means ]
k-means:cluster-by-xy patches 5 100 0.1 => ERROR Extension exception: Expected input to be a turtle set.