### Home Classes Methods

### In Files

- lib/goals.rb

### Parent

Goal

### Methods

- ::new
- #satisfied?

### Files

- LessThan5BlueLabels.txt
- AtLeast2LargeSegments.txt

### Class Index

Quicksearch

- AddLabelTool
- AllRulesAppliedGoal
- Area
- AreaConstraint
- Array
- BalancedBinaryTree
- BalancedBinaryTreeNode
- CloseObserver
- Constants
- Constraint
- CurrentLabelledShape
- DistinctShapeConstraint
- Execution
- Goal
- Grammar
- Label
- LabelledShape
- LineDescriptor
- LinearLinkedList
- LinearLinkedListNode
- NoLabelsGoal
- NoMoreRulesGoal
- NoScalesConstraint
- Numeric
- Object
- OrderedPoint
- PiList
- Point
- Project
- Robot
- Rule
- RuleGroupsObserver
- RuleLabelledShape
- RuleShapeObserver
- Segment
- ShaDeLayersObserver
- Shade
- ShadeUtils
- UndoObserver

No matching classes.

# AllRulesAppliedGoal

Author | Manuela Ruiz (mruiz@lcc.uma.es)

A sort of goal: satisfied when all the rules in the grammar have been applied

### Public Class Methods

new() click to toggle source

Initialize the goal

        # File lib/goals.rb, line 68
    68:         def initialize

    69:                 @name = Constants::ALL_RULES_APPLIED_GOAL_NAME

    70:         end

### Public Instance Methods

satisfied?() click to toggle source

returns | true iff all the rules in the grammar have been applied

        # File lib/goals.rb, line 73
    73:         def satisfied?

    74:                 satisfied = true

    75:

    76:                 if Shade.project.execution.execution_history

    77:                         i = 0

    78:                         while ((i < Shade.project.execution.grammar.rules.size) && (satisfied))

    79:                                 rule_id = Shade.project.execution.grammar.rules[i].rule_id

    80:                                 j = 0

    81:                                 found = false

    82:                                 while ((j < Shade.project.execution.execution_history.size) && (!found))

    83:                                         if Shade.project.execution.execution_history[j][0] == rule_id

    84:                                                 found = true

    85:                                         end

    86:                                         j += 1

    87:                                 end

    88:                                 satisfied = found

    89:                                 i += 1

    90:                         end

    91:                 else

    92:                         satisfied = false

    93:                 end

    94:

    95:                 return satisfied

    96:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.