saasagi 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/saasagi.rb +32 -30
- data/lib/saasagi/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 998a121cb3f7370950eb118e80f5da5f6f891f28983eb4e81038bdcc3443840f
|
4
|
+
data.tar.gz: 99daae8fd4e00281660ebed56f46fd9fd203496c35272806199d2af18f1c6afa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26f8c23425f66daef79cccaf841c3cc88b3b764c6848dcb79f17dd48dfaf5d0165bb5e4a189bc2c2bdcadfbc0a8ff675d34bbe6703ab30d3769fa074051c4c1e
|
7
|
+
data.tar.gz: 20c96666c076d862846316bb82194036f9a31d09f05efffc565d22b664c4db2f9a237b7df7be196a7f8a27b0540269994bcb406942d0a9e9ddff700a4cb7a3c2
|
data/lib/saasagi.rb
CHANGED
@@ -21,7 +21,7 @@ module Saasagi
|
|
21
21
|
}
|
22
22
|
end
|
23
23
|
|
24
|
-
def self.
|
24
|
+
def self.assemble_duck_search
|
25
25
|
prewrite = File.read(".prewrite/tree_ducksearch.txt")
|
26
26
|
|
27
27
|
open("data/input/duck_ratio.txt", "w") { |f|
|
@@ -197,26 +197,28 @@ module Saasagi
|
|
197
197
|
f.puts "def #{method_name}#{ratio}"
|
198
198
|
f.puts " require 'decisiontree'"
|
199
199
|
f.puts " "
|
200
|
-
f.puts " def robot_#{method_name}"
|
201
|
-
f.puts " a = ai_#{action}"
|
202
|
-
f.puts " end"
|
203
|
-
f.puts " "
|
204
200
|
f.puts " def confirm_deny"
|
205
|
-
f.puts "
|
206
|
-
f.puts " input = gets.chomp"
|
207
|
-
f.puts " "
|
208
|
-
f.puts " if input == '#{action}'"
|
209
|
-
f.puts " a = ai_#{action}"
|
210
|
-
f.puts " elsif input == 'stay'"
|
211
|
-
f.puts " require 'espeak'"
|
201
|
+
f.puts " decision = $decision"
|
212
202
|
f.puts " "
|
213
|
-
f.puts "
|
214
|
-
f.puts "
|
203
|
+
f.puts " if decision == 'Automatic'"
|
204
|
+
f.puts " ai = ai_#{action}"
|
215
205
|
f.puts " else"
|
216
|
-
f.puts "
|
206
|
+
f.puts " print 'Robot is increasingly restless, #{action} or stay? >> '"
|
207
|
+
f.puts " input = gets.chomp"
|
208
|
+
f.puts " "
|
209
|
+
f.puts " if input == '#{action}'"
|
210
|
+
f.puts " a = ai_#{action}"
|
211
|
+
f.puts " elsif input == 'stay'"
|
212
|
+
f.puts " require 'espeak'"
|
213
|
+
f.puts " "
|
214
|
+
f.puts " speech = ESpeak::Speech.new('I chose to stay.')"
|
215
|
+
f.puts " speech.speak"
|
216
|
+
f.puts " else"
|
217
|
+
f.puts " require 'espeak'"
|
217
218
|
f.puts " "
|
218
|
-
f.puts "
|
219
|
-
f.puts "
|
219
|
+
f.puts " speech = ESpeak::Speech.new('Command not understood.')"
|
220
|
+
f.puts " speech.speak"
|
221
|
+
f.puts " end"
|
220
222
|
f.puts " end"
|
221
223
|
f.puts " end"
|
222
224
|
f.puts " "
|
@@ -233,21 +235,21 @@ module Saasagi
|
|
233
235
|
f.puts " dec_tree = DecisionTree::ID3Tree.new(attributes, training, 1, :continuous); dec_tree.train"
|
234
236
|
f.puts " test = [input]"
|
235
237
|
f.puts " "
|
236
|
-
f.puts " decision = dec_tree.predict(test)"
|
237
|
-
f.puts " true_decision = test.last"
|
238
|
+
f.puts " $decision = dec_tree.predict(test)"
|
239
|
+
f.puts " $true_decision = test.last"
|
238
240
|
f.puts " "
|
239
|
-
f.puts " print '#{method_name.upcase}: '; print decision"
|
240
|
-
f.puts " puts '\n'"
|
241
|
+
f.puts " print '#{method_name.upcase}: '; print $decision"
|
242
|
+
f.puts " puts '\n\N'"
|
241
243
|
f.puts " "
|
242
|
-
f.puts " if decision == 'Very Low' or 13.75; c = confirm_deny"
|
243
|
-
f.puts " elsif decision == 'Somewhat Low' or 20.625; c = confirm_deny"
|
244
|
-
f.puts " elsif decision == 'Normal Low' or 67.5; c = confirm_deny"
|
245
|
-
f.puts " elsif decision == 'Medium' or 37.3125; c = confirm_deny"
|
246
|
-
f.puts " elsif decision == 'High' or 54.0; c = confirm_deny"
|
247
|
-
f.puts " elsif decision == 'Urgent' or 67.5; c = confirm_deny"
|
248
|
-
f.puts " elsif decision == 'Danger' or 81.0; c = confirm_deny"
|
249
|
-
f.puts " elsif decision == 'Critical' or 94.5; c = confirm_deny"
|
250
|
-
f.puts " elsif decision == 'Automatic' or 108.0; r = robot_#{method_name}"
|
244
|
+
f.puts " if $decision == 'Very Low' or 13.75; c = confirm_deny"
|
245
|
+
f.puts " elsif $decision == 'Somewhat Low' or 20.625; c = confirm_deny"
|
246
|
+
f.puts " elsif $decision == 'Normal Low' or 67.5; c = confirm_deny"
|
247
|
+
f.puts " elsif $decision == 'Medium' or 37.3125; c = confirm_deny"
|
248
|
+
f.puts " elsif $decision == 'High' or 54.0; c = confirm_deny"
|
249
|
+
f.puts " elsif $decision == 'Urgent' or 67.5; c = confirm_deny"
|
250
|
+
f.puts " elsif $decision == 'Danger' or 81.0; c = confirm_deny"
|
251
|
+
f.puts " elsif $decision == 'Critical' or 94.5; c = confirm_deny"
|
252
|
+
f.puts " elsif $decision == 'Automatic' or 108.0; r = robot_#{method_name}"
|
251
253
|
f.puts " end"
|
252
254
|
f.puts " "
|
253
255
|
f.puts "end"
|
data/lib/saasagi/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: saasagi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- LWFlouisa
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|