class Botwings::BotWings

Public Class Methods

reset_evo() click to toggle source
# 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
reshape() click to toggle source
# 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_form() click to toggle source
# 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