Class: RubyAi::Search::Core::Frontier

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_ai/search/core/frontier.rb

Direct Known Subclasses

PriorityQueue, Queue, Stack

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFrontier

Returns a new instance of Frontier.



8
9
10
# File 'lib/ruby_ai/search/core/frontier.rb', line 8

def initialize
  @store = []
end

Instance Attribute Details

#storeObject (readonly)

Returns the value of attribute store.



6
7
8
# File 'lib/ruby_ai/search/core/frontier.rb', line 6

def store
  @store
end

Instance Method Details

#append(element:) ⇒ Object

Raises:

  • (NotImplementedError)


12
13
14
# File 'lib/ruby_ai/search/core/frontier.rb', line 12

def append(element:)
  raise NotImplementedError
end

#empty?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/ruby_ai/search/core/frontier.rb', line 24

def empty?
  @store.empty?
end

#include?(element:) ⇒ Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/ruby_ai/search/core/frontier.rb', line 28

def include?(element:)
  @store.include?(element)
end

#popObject

Raises:

  • (NotImplementedError)


16
17
18
# File 'lib/ruby_ai/search/core/frontier.rb', line 16

def pop
  raise NotImplementedError
end

#sizeObject



20
21
22
# File 'lib/ruby_ai/search/core/frontier.rb', line 20

def size
  @store.size
end