Class: OMF::Rete::Planner::AbstractPlan
- Inherits:
-
Object
- Object
- OMF::Rete::Planner::AbstractPlan
- Defined in:
- lib/omf_rete/planner/abstract_plan.rb
Overview
This class is the super class for all plans
Direct Known Subclasses
Instance Attribute Summary collapse
-
#cover_set ⇒ Object
readonly
Returns the value of attribute cover_set.
-
#result_set ⇒ Object
readonly
Returns the value of attribute result_set.
Instance Method Summary collapse
-
#complete ⇒ Object
Set this plan to be complete.
-
#complete? ⇒ Boolean
Return true if this plan is a complete one.
-
#initialize(coverSet, resultSet) ⇒ AbstractPlan
constructor
coverSet – set of source plans covered by this plan resultSet – set of bindings provided by this source.
- #result_description ⇒ Object
-
#used ⇒ Object
Informs the plan that it is used by some higher plan.
-
#used? ⇒ Boolean
Return true if used by some higher plan.
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_set ⇒ Object (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_set ⇒ Object (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
#complete ⇒ Object
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.
33 34 35 |
# File 'lib/omf_rete/planner/abstract_plan.rb', line 33 def complete?() @is_complete end |
#result_description ⇒ Object
23 24 25 |
# File 'lib/omf_rete/planner/abstract_plan.rb', line 23 def result_description @result_set.to_a.sort end |
#used ⇒ Object
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
45 46 47 |
# File 'lib/omf_rete/planner/abstract_plan.rb', line 45 def used?() @is_used end |