Class: ImpUnit::BotWings

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

Class Method Summary collapse

Class Method Details

.reset_evoObject



500
501
502
503
504
505
506
# File 'lib/ImpUnit.rb', line 500

def self.reset_evo
  reset_usr_input = 0

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

.reshapeObject



526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
# File 'lib/ImpUnit.rb', line 526

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]

  print "The user #{model_type} model has: #{current_wingset}"
  print "The bot #{model_type} model has: #{current_botwings}"

  if current_wingset == current_botwings
    ImpUnit::BotWings.use_form

    sleep(3)
    # ImpUnit::BotWings.reset_evo
  else
    # system("tts 'Form status: Changing form...', 'en'")

    puts "Form status: Changing form..."

    sleep(3)

    new_value = number + 1

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

    ImpUnit::BotWings.reshape
  end

  ImpUnit::BotWings.reshape
end

.use_formObject



508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
# File 'lib/ImpUnit.rb', line 508

def self.use_form
  puts "Form status: Suitable..."

  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