def check_agent(options, cfg)
      identity = options[:identity]
      agent_type = options[:agent_type]
      type = AgentIdentity.parse(identity).agent_type if identity
      fail("Agent type #{agent_type.inspect} and identity #{identity.inspect} are inconsistent") if agent_type != type
      fail("Cannot find agent init.rb file in init directory of #{AgentConfig.root_dir.inspect}") unless AgentConfig.init_file

      actors = cfg[:actors]
      fail('Agent configuration is missing actors') unless actors && actors.respond_to?(:each)
      actors_dirs = AgentConfig.actors_dirs
      actors.each do |a|
        found = false
        actors_dirs.each { |d| break if (found = File.exist?(File.normalize_path(File.join(d, "#{a}.rb")))) }
        fail("Cannot find source for actor #{a.inspect} in #{actors_dirs.inspect}") unless found
      end
      true
    end
def check_agent(options, cfg)
      identity = options[:identity]
      agent_type = options[:agent_type]
      type = AgentIdentity.parse(identity).agent_type if identity
      fail("Agent type #{agent_type.inspect} and identity #{identity.inspect} are inconsistent") if agent_type != type
      fail("Cannot find agent init.rb file in init directory of #{AgentConfig.root_dir.inspect}") unless AgentConfig.init_file

      actors = cfg[:actors]
      fail('Agent configuration is missing actors') unless actors && actors.respond_to?(:each)
      actors_dirs = AgentConfig.actors_dirs
      actors.each do |a|
        found = false
        actors_dirs.each { |d| break if (found = File.exist?(File.normalize_path(File.join(d, "#{a}.rb")))) }
        fail("Cannot find source for actor #{a.inspect} in #{actors_dirs.inspect}") unless found
      end
      true
    end
Check agent type consistency and existence of initialization file and actors directory

 === Parameters
 options(Hash):: Command line options
 cfg(Hash):: Initial configuration settings

 === Return
 true:: Always return true