Class: OMF::Rete::Planner::AbstractPlan

Inherits:
Object
  • Object
show all
Defined in:
lib/omf_rete/planner/abstract_plan.rb

Overview

This class is the super class for all plans

Direct Known Subclasses

JoinPlan, SourcePlan

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(coverSet, resultSet) ⇒ AbstractPlan

coverSet – set of source plans covered by this plan resultSet – set of bindings provided by this source



16
17
18
19
20
21
# File 'lib/omf_rete/planner/abstract_plan.rb', line 16

def initialize(coverSet, resultSet)
  @cover_set = coverSet
  @result_set = resultSet
  @is_used = false
  @is_complete = false
end

Instance Attribute Details

#cover_setObject (readonly)

Returns the value of attribute cover_set.



10
11
12
# File 'lib/omf_rete/planner/abstract_plan.rb', line 10

def cover_set
  @cover_set
end

#result_setObject (readonly)

Returns the value of attribute result_set.



10
11
12
# File 'lib/omf_rete/planner/abstract_plan.rb', line 10

def result_set
  @result_set
end

Instance Method Details

#completeObject

Set this plan to be complete



39
40
41
# File 'lib/omf_rete/planner/abstract_plan.rb', line 39

def complete()
  @is_complete = true
end

#complete?Boolean

Return true if this plan is a complete one.

A complete plan covers (@coverSet) all leaf plans.

Returns:

  • (Boolean)


33
34
35
# File 'lib/omf_rete/planner/abstract_plan.rb', line 33

def complete?()
  @is_complete
end

#result_descriptionObject



23
24
25
# File 'lib/omf_rete/planner/abstract_plan.rb', line 23

def result_description
  @result_set.to_a.sort
end

#usedObject

Informs the plan that it is used by some higher plan



51
52
53
# File 'lib/omf_rete/planner/abstract_plan.rb', line 51

def used()
  @is_used = true
end

#used?Boolean

Return true if used by some higher plan

Returns:

  • (Boolean)


45
46
47
# File 'lib/omf_rete/planner/abstract_plan.rb', line 45

def used?()
  @is_used
end