module NEAT::DSL

Public Instance Methods

bind(bindaddr) click to toggle source

FIXME: this is set too late in the game.

# File lib/rubyneat_dashboard/rubyneat_dsl.rb, line 32
def bind(bindaddr)
  Dashboard::opts.bindaddr = bindaddr
end
dashboard(&block) click to toggle source
# File lib/rubyneat_dashboard/rubyneat_dsl.rb, line 23
def dashboard(&block)
  Dashboard::dq ||= DashboardQueues.new

  #FIXME: this is set too late in the game.
  def port(portnum)
    Dashboard::opts.port = portnum
  end

  #FIXME: this is set too late in the game.
  def bind(bindaddr)
    Dashboard::opts.bindaddr = bindaddr
  end

  block.() if block_given?
  Dashboard::run_dashboard!

  NEAT::controller.pre_exit_add do
    puts "Dashboard waiting for user to exit. Or you may do a ^C."
    Dashboard::join!
    puts "Dashboard exited."
  end

  NEAT::controller.end_run_add  do |c|
    puts 'Dashboard end_run called.'
  end

  NEAT::controller.report_add do |pop, rept|
    Dashboard.dq.population << Dashboard.report_on(pop, rept)
  end
end
port(portnum) click to toggle source

FIXME: this is set too late in the game.

# File lib/rubyneat_dashboard/rubyneat_dsl.rb, line 27
def port(portnum)
  Dashboard::opts.port = portnum
end