Class: Botwings::BotWings

Inherits:
Object
  • Object
show all
Defined in:
lib/botwings.rb

Class Method Summary collapse

Class Method Details

.reset_evoObject



7
8
9
10
11
12
13
# File 'lib/botwings.rb', line 7

def self.reset_evo
  reset_usr_input = 0

  open("data/number/input.txt", "w") { |f|
    f.puts reset_usr_input
  }
end

.reshapeObject



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
# File 'lib/botwings.rb', line 33

def self.reshape
  system("clear")

  model_type = File.read("data/model/model_type.txt").strip

  bot_choice = File.read("data/bot_input/input.txt").strip.to_i
  number     = File.read("data/number/input.txt").strip.to_i

  usr_wings = File.readlines("data/usr_shape/wings.txt")
  bot_wings = File.readlines("data/bot_shape/wings.txt")

  current_wingset  = usr_wings[number]
  current_botwings = bot_wings[bot_choice]

  system("tts 'The user #{model_type} model is: #{current_wingset}', 'en'")
  system("tts 'The bot #{model_type} model is: #{current_botwings}', 'en'")

  if current_wingset == current_botwings
    use_form
  else
    system("tts 'Form status: Changing form...', 'en'")

    sleep(3)

    new_value = number + 1

    open("data/number/input.txt", "w") { |f|
      f.puts new_value
    }
  end

  Botwings::BotWings.reshape
end

.use_formObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/botwings.rb', line 15

def self.use_form
  system("tts 'Form status: Suitable...', 'en'")

  sleep(3)

  ## Detect bot form
  ## bot_choice = File.read("data/bot_input/input.txt").strip.to_i
  ## bot_wings = File.readlines("data/bot_shape/wings.txt")

  ## Form conditional
  ## if bot form is decision tree
  ## elsif bot form is naive bayes
  ## elsif bot form is biometrics
  ## elsif bot form is "infinite learning algorithm"

  abort
end