Parent

Methods

NoScalesConstraint

Author

Manuela Ruiz (mruiz@lcc.uma.es)

A sort of Constraint: the applied rule must not involve scales

Public Class Methods

new() click to toggle source

Initializing

    # File lib/constraints.rb, line 54
54:         def initialize()

55:                 @name = Constants::NO_SCALES_CONSTRAINT_NAME

56:         end

Public Instance Methods

satisfied?() click to toggle source

Returns true iff the design complies the Constraint

    # File lib/constraints.rb, line 59
59:         def satisfied?()

60:                 result = true

61:                 if Shade.project.execution.execution_history.size > 0

62:                         last_t = Shade.project.execution.execution_history.last[1]

63: 

64:                         sx = Math.sqrt(last_t[0]**2 + last_t[1]**2)

65:                         if ((sx - 1).abs > 0.001) #If there is a scale...

66:                                 result = false

67:                         end

68:                 end

69:                 return result

70:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.