diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-03-28 15:49:50 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-03-28 15:49:50 -0400 |
commit | 251248adfab36b061eb8fdd08aa54b318462da65 (patch) | |
tree | 4ff1eb792a1e1b442ec2fa6a99e01b28518c5cf4 /generator/mood.cpp | |
parent | af49d3435302118d036c512aef1def848fb88089 (diff) | |
download | cadence-251248adfab36b061eb8fdd08aa54b318462da65.tar.gz cadence-251248adfab36b061eb8fdd08aa54b318462da65.tar.bz2 cadence-251248adfab36b061eb8fdd08aa54b318462da65.zip |
Revamped bot with new algorithm
The percentages currently used by the generator are trial-and-error and may be changed in the future. refs #1
Diffstat (limited to 'generator/mood.cpp')
-rw-r--r-- | generator/mood.cpp | 94 |
1 files changed, 0 insertions, 94 deletions
diff --git a/generator/mood.cpp b/generator/mood.cpp deleted file mode 100644 index b74211c..0000000 --- a/generator/mood.cpp +++ /dev/null | |||
@@ -1,94 +0,0 @@ | |||
1 | #include "mood.h" | ||
2 | |||
3 | namespace cadence { | ||
4 | namespace generator { | ||
5 | |||
6 | // The categories are: | ||
7 | // - party (+danceable, -acoustic, +electronic, +party) = ~.21 | ||
8 | // - chill (-danceable, +acoustic, -aggressive, -electronic, -party, +relaxed) = ~.49 | ||
9 | // - crazy (+aggressive, -relaxed) = ~.02 | ||
10 | // - happy (+happy, -sad) = ~.009 | ||
11 | // - sad (-happy, +sad) = ~.02 | ||
12 | // - instrumental (+instrumental) = ~.12 | ||
13 | // - vocal (-instrumental) = ~.10 | ||
14 | |||
15 | mood::mood(type t, double prob) : type_(t) | ||
16 | { | ||
17 | if (prob >= 0.5) | ||
18 | { | ||
19 | probability_ = prob; | ||
20 | positive_ = true; | ||
21 | } else { | ||
22 | probability_ = 1.0 - prob; | ||
23 | positive_ = false; | ||
24 | } | ||
25 | |||
26 | switch (t) | ||
27 | { | ||
28 | case type::danceable: | ||
29 | { | ||
30 | category_ = (positive_ ? "party" : "chill"); | ||
31 | |||
32 | break; | ||
33 | } | ||
34 | |||
35 | case type::acoustic: | ||
36 | { | ||
37 | category_ = (positive_ ? "chill" : "party"); | ||
38 | |||
39 | break; | ||
40 | } | ||
41 | |||
42 | case type::aggressive: | ||
43 | { | ||
44 | category_ = (positive_ ? "crazy" : "chill"); | ||
45 | |||
46 | break; | ||
47 | } | ||
48 | |||
49 | case type::electronic: | ||
50 | { | ||
51 | category_ = (positive_ ? "party" : "chill"); | ||
52 | |||
53 | break; | ||
54 | } | ||
55 | |||
56 | case type::happy: | ||
57 | { | ||
58 | category_ = (positive_ ? "happy" : "sad"); | ||
59 | |||
60 | break; | ||
61 | } | ||
62 | |||
63 | case type::party: | ||
64 | { | ||
65 | category_ = (positive_ ? "party" : "chill"); | ||
66 | |||
67 | break; | ||
68 | } | ||
69 | |||
70 | case type::relaxed: | ||
71 | { | ||
72 | category_ = (positive_ ? "chill" : "crazy"); | ||
73 | |||
74 | break; | ||
75 | } | ||
76 | |||
77 | case type::sad: | ||
78 | { | ||
79 | category_ = (positive_ ? "sad" : "happy"); | ||
80 | |||
81 | break; | ||
82 | } | ||
83 | |||
84 | case type::instrumental: | ||
85 | { | ||
86 | category_ = (positive_ ? "instrumental" : "vocal"); | ||
87 | |||
88 | break; | ||
89 | } | ||
90 | } | ||
91 | } | ||
92 | |||
93 | }; | ||
94 | }; | ||